line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package CPAN::Changes::Release; |
2
|
|
|
|
|
|
|
|
3
|
22
|
|
|
22
|
|
95
|
use strict; |
|
22
|
|
|
|
|
36
|
|
|
22
|
|
|
|
|
736
|
|
4
|
22
|
|
|
22
|
|
85
|
use warnings; |
|
22
|
|
|
|
|
33
|
|
|
22
|
|
|
|
|
439
|
|
5
|
|
|
|
|
|
|
|
6
|
22
|
|
|
22
|
|
12010
|
use Text::Wrap (); |
|
22
|
|
|
|
|
55685
|
|
|
22
|
|
|
|
|
526
|
|
7
|
22
|
|
|
22
|
|
8842
|
use CPAN::Changes::Group; |
|
22
|
|
|
|
|
218
|
|
|
22
|
|
|
|
|
631
|
|
8
|
22
|
|
|
22
|
|
111
|
use Scalar::Util qw(blessed); |
|
22
|
|
|
|
|
28
|
|
|
22
|
|
|
|
|
19728
|
|
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
sub new { |
11
|
86
|
|
|
86
|
1
|
109
|
my $class = shift; |
12
|
86
|
|
|
|
|
522
|
return bless { |
13
|
|
|
|
|
|
|
changes => {}, |
14
|
|
|
|
|
|
|
@_, |
15
|
|
|
|
|
|
|
}, $class; |
16
|
|
|
|
|
|
|
} |
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
sub version { |
19
|
454
|
|
|
454
|
1
|
12068
|
my $self = shift; |
20
|
|
|
|
|
|
|
|
21
|
454
|
50
|
|
|
|
673
|
if ( @_ ) { |
22
|
0
|
|
|
|
|
0
|
$self->{ version } = shift; |
23
|
|
|
|
|
|
|
} |
24
|
|
|
|
|
|
|
|
25
|
454
|
|
|
|
|
1075
|
return $self->{ version }; |
26
|
|
|
|
|
|
|
} |
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
sub date { |
29
|
56
|
|
|
56
|
1
|
7413
|
my $self = shift; |
30
|
|
|
|
|
|
|
|
31
|
56
|
50
|
|
|
|
150
|
if ( @_ ) { |
32
|
0
|
|
|
|
|
0
|
$self->{ date } = shift; |
33
|
|
|
|
|
|
|
} |
34
|
|
|
|
|
|
|
|
35
|
56
|
|
|
|
|
191
|
return $self->{ date }; |
36
|
|
|
|
|
|
|
} |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
sub note { |
39
|
29
|
|
|
29
|
1
|
31
|
my $self = shift; |
40
|
|
|
|
|
|
|
|
41
|
29
|
50
|
|
|
|
59
|
if ( @_ ) { |
42
|
0
|
|
|
|
|
0
|
$self->{ note } = shift; |
43
|
|
|
|
|
|
|
} |
44
|
|
|
|
|
|
|
|
45
|
29
|
|
|
|
|
70
|
return $self->{ note }; |
46
|
|
|
|
|
|
|
} |
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
sub changes { |
49
|
77
|
|
|
77
|
1
|
90
|
my $self = shift; |
50
|
|
|
|
|
|
|
|
51
|
77
|
100
|
|
|
|
170
|
if ( @_ ) { |
52
|
57
|
|
|
|
|
52
|
my $group = shift; |
53
|
57
|
50
|
|
|
|
131
|
return unless exists $self->{ changes }->{ $group }; |
54
|
57
|
|
|
|
|
141
|
return $self->{ changes }->{ $group }->changes; |
55
|
|
|
|
|
|
|
} |
56
|
|
|
|
|
|
|
|
57
|
20
|
|
|
|
|
30
|
return { map { $_ => $self->{ changes }->{$_}->changes } keys %{ $self->{ changes } } }; |
|
19
|
|
|
|
|
83
|
|
|
20
|
|
|
|
|
83
|
|
58
|
|
|
|
|
|
|
} |
59
|
|
|
|
|
|
|
|
60
|
|
|
|
|
|
|
sub add_changes { |
61
|
114
|
|
|
114
|
1
|
137
|
my $self = shift; |
62
|
114
|
|
|
|
|
111
|
my $group = ''; |
63
|
|
|
|
|
|
|
|
64
|
114
|
100
|
|
|
|
231
|
if ( ref $_[ 0 ] ) { |
65
|
113
|
|
|
|
|
152
|
$group = shift->{ group }; |
66
|
|
|
|
|
|
|
} |
67
|
|
|
|
|
|
|
|
68
|
114
|
|
|
|
|
214
|
$self->get_group( $group )->add_changes( @_ ); |
69
|
|
|
|
|
|
|
} |
70
|
|
|
|
|
|
|
|
71
|
|
|
|
|
|
|
sub set_changes { |
72
|
0
|
|
|
0
|
1
|
0
|
my $self = shift; |
73
|
0
|
|
|
|
|
0
|
my $group = ''; |
74
|
|
|
|
|
|
|
|
75
|
0
|
0
|
|
|
|
0
|
if ( ref $_[ 0 ] ) { |
76
|
0
|
|
|
|
|
0
|
$group = shift->{ group }; |
77
|
|
|
|
|
|
|
} |
78
|
|
|
|
|
|
|
|
79
|
0
|
|
|
|
|
0
|
$self->get_group( $group )->set_changes(@_); |
80
|
|
|
|
|
|
|
} |
81
|
|
|
|
|
|
|
|
82
|
|
|
|
|
|
|
sub clear_changes { |
83
|
1
|
|
|
1
|
1
|
5
|
my $self = shift; |
84
|
1
|
|
|
|
|
3
|
$self->{ changes } = {}; |
85
|
|
|
|
|
|
|
} |
86
|
|
|
|
|
|
|
|
87
|
|
|
|
|
|
|
sub groups { |
88
|
41
|
|
|
41
|
1
|
371
|
my $self = shift; |
89
|
41
|
|
|
|
|
83
|
my %args = @_; |
90
|
|
|
|
|
|
|
|
91
|
41
|
|
100
|
37
|
|
300
|
$args{ sort } ||= sub { sort @_ }; |
|
37
|
|
|
|
|
206
|
|
92
|
|
|
|
|
|
|
|
93
|
41
|
|
|
|
|
49
|
return $args{ sort }->( keys %{ $self->{ changes } } ); |
|
41
|
|
|
|
|
139
|
|
94
|
|
|
|
|
|
|
} |
95
|
|
|
|
|
|
|
|
96
|
|
|
|
|
|
|
sub get_group { |
97
|
143
|
|
|
143
|
1
|
142
|
my $self = shift; |
98
|
143
|
|
|
|
|
136
|
my $group = ''; |
99
|
|
|
|
|
|
|
|
100
|
143
|
100
|
|
|
|
248
|
if ( $_[ 0 ] ) { |
101
|
50
|
|
|
|
|
49
|
$group = shift; |
102
|
|
|
|
|
|
|
} |
103
|
143
|
100
|
|
|
|
343
|
if ( !exists $self->{ changes }->{ $group } ) { |
104
|
61
|
|
|
|
|
228
|
$self->{ changes }->{ $group } = CPAN::Changes::Group->new( name => $group ); |
105
|
|
|
|
|
|
|
} |
106
|
143
|
100
|
|
|
|
480
|
if ( not blessed $self->{changes}->{$group} ) { |
107
|
7
|
|
|
|
|
26
|
$self->{ changes }->{ $group } = CPAN::Changes::Group->new( name => $group , changes => $self->{changes}->{$group} ); |
108
|
|
|
|
|
|
|
} |
109
|
|
|
|
|
|
|
|
110
|
143
|
|
|
|
|
431
|
return $self->{ changes }->{ $group }; |
111
|
|
|
|
|
|
|
} |
112
|
|
|
|
|
|
|
|
113
|
|
|
|
|
|
|
sub attach_group { |
114
|
0
|
|
|
0
|
1
|
0
|
my $self = shift; |
115
|
0
|
|
|
|
|
0
|
my $group = shift; |
116
|
|
|
|
|
|
|
|
117
|
0
|
0
|
|
|
|
0
|
die "Not a group" unless blessed $group; |
118
|
|
|
|
|
|
|
|
119
|
0
|
|
|
|
|
0
|
my $name = $group->name; |
120
|
|
|
|
|
|
|
|
121
|
0
|
|
|
|
|
0
|
$self->{changes}->{$name} = $group; |
122
|
|
|
|
|
|
|
|
123
|
|
|
|
|
|
|
} |
124
|
|
|
|
|
|
|
|
125
|
|
|
|
|
|
|
sub group_values { |
126
|
20
|
|
|
20
|
1
|
32
|
my $self = shift; |
127
|
20
|
|
|
|
|
34
|
return map { $self->get_group( $_ ) } $self->groups( @_ ); |
|
29
|
|
|
|
|
54
|
|
128
|
|
|
|
|
|
|
} |
129
|
|
|
|
|
|
|
|
130
|
|
|
|
|
|
|
sub add_group { |
131
|
17
|
|
|
17
|
1
|
20
|
my $self = shift; |
132
|
17
|
|
|
|
|
80
|
$self->{ changes }->{ $_ } = CPAN::Changes::Group->new( name => $_ ) for @_; |
133
|
|
|
|
|
|
|
} |
134
|
|
|
|
|
|
|
|
135
|
|
|
|
|
|
|
sub delete_group { |
136
|
2
|
|
|
2
|
1
|
3
|
my $self = shift; |
137
|
2
|
|
|
|
|
3
|
my @groups = @_; |
138
|
|
|
|
|
|
|
|
139
|
2
|
50
|
|
|
|
4
|
@groups = ( '' ) unless @groups; |
140
|
|
|
|
|
|
|
|
141
|
2
|
|
|
|
|
20
|
delete $self->{ changes }->{ $_ } for @groups; |
142
|
|
|
|
|
|
|
} |
143
|
|
|
|
|
|
|
|
144
|
|
|
|
|
|
|
sub delete_empty_groups { |
145
|
4
|
|
|
4
|
1
|
4
|
my $self = shift; |
146
|
|
|
|
|
|
|
|
147
|
7
|
|
|
|
|
11
|
$self->delete_group($_->name) |
148
|
4
|
|
|
|
|
8
|
for grep { $_->is_empty } $self->group_values; |
149
|
|
|
|
|
|
|
} |
150
|
|
|
|
|
|
|
|
151
|
|
|
|
|
|
|
sub serialize { |
152
|
16
|
|
|
16
|
1
|
344
|
my $self = shift; |
153
|
16
|
|
|
|
|
21
|
my %args = @_; |
154
|
|
|
|
|
|
|
|
155
|
16
|
100
|
|
|
|
27
|
my $output = join( ' ', grep { defined && length } ( $self->version, $self->date, $self->note ) ) |
|
48
|
|
|
|
|
162
|
|
156
|
|
|
|
|
|
|
. "\n"; |
157
|
|
|
|
|
|
|
|
158
|
22
|
|
|
|
|
50
|
$output .= join "\n", |
159
|
16
|
|
|
|
|
50
|
map { $_->serialize } $self->group_values( sort => $args{ group_sort } ); |
160
|
16
|
|
|
|
|
34
|
$output .= "\n"; |
161
|
|
|
|
|
|
|
|
162
|
16
|
|
|
|
|
63
|
return $output; |
163
|
|
|
|
|
|
|
} |
164
|
|
|
|
|
|
|
|
165
|
|
|
|
|
|
|
1; |
166
|
|
|
|
|
|
|
|
167
|
|
|
|
|
|
|
__END__ |