line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package CPAN::Changes::Group; |
2
|
|
|
|
|
|
|
|
3
|
23
|
|
|
23
|
|
27292
|
use strict; |
|
23
|
|
|
|
|
24
|
|
|
23
|
|
|
|
|
705
|
|
4
|
23
|
|
|
23
|
|
86
|
use warnings; |
|
23
|
|
|
|
|
30
|
|
|
23
|
|
|
|
|
492
|
|
5
|
|
|
|
|
|
|
|
6
|
23
|
|
|
23
|
|
510
|
use Text::Wrap (); |
|
23
|
|
|
|
|
2241
|
|
|
23
|
|
|
|
|
6714
|
|
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
sub new { |
9
|
89
|
|
|
89
|
1
|
20405
|
my $class = shift; |
10
|
89
|
|
|
|
|
484
|
return bless { |
11
|
|
|
|
|
|
|
changes => [], |
12
|
|
|
|
|
|
|
@_, |
13
|
|
|
|
|
|
|
}, $class; |
14
|
|
|
|
|
|
|
} |
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
# Intentionally read only |
17
|
|
|
|
|
|
|
# to prevent hash key and name being out of sync. |
18
|
|
|
|
|
|
|
sub name { |
19
|
24
|
|
|
24
|
1
|
27
|
my $self = shift; |
20
|
24
|
50
|
|
|
|
49
|
if ( not exists $self->{ name } ) { |
21
|
0
|
|
|
|
|
0
|
$self->{ name } = q[]; |
22
|
|
|
|
|
|
|
} |
23
|
24
|
|
|
|
|
46
|
return $self->{ name }; |
24
|
|
|
|
|
|
|
} |
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
sub changes { |
27
|
107
|
|
|
107
|
1
|
158
|
my $self = shift; |
28
|
107
|
|
|
|
|
475
|
return $self->{ changes }; |
29
|
|
|
|
|
|
|
} |
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
sub add_changes { |
32
|
116
|
|
|
116
|
1
|
113
|
my $self = shift; |
33
|
116
|
|
|
|
|
90
|
push @{ $self->{ changes } }, @_; |
|
116
|
|
|
|
|
462
|
|
34
|
|
|
|
|
|
|
} |
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
sub set_changes { |
37
|
0
|
|
|
0
|
1
|
0
|
my $self = shift; |
38
|
0
|
|
|
|
|
0
|
$self->{ changes } = \@_; |
39
|
|
|
|
|
|
|
} |
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
sub clear_changes { |
42
|
0
|
|
|
0
|
1
|
0
|
my $self = shift; |
43
|
0
|
|
|
|
|
0
|
$self->{ changes } = []; |
44
|
|
|
|
|
|
|
} |
45
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
sub is_empty { |
47
|
7
|
|
|
7
|
1
|
8
|
my $self = shift; |
48
|
7
|
|
|
|
|
6
|
return !@{ $self->changes }; |
|
7
|
|
|
|
|
9
|
|
49
|
|
|
|
|
|
|
} |
50
|
|
|
|
|
|
|
|
51
|
|
|
|
|
|
|
sub serialize { |
52
|
22
|
|
|
22
|
1
|
23
|
my $self = shift; |
53
|
22
|
|
|
|
|
29
|
my %args = @_; |
54
|
|
|
|
|
|
|
|
55
|
22
|
|
|
|
|
22
|
my $output = ''; |
56
|
22
|
|
|
|
|
36
|
my $name = $self->name; |
57
|
22
|
100
|
|
|
|
104
|
$output .= sprintf " [%s]\n", $name if length $name; |
58
|
|
|
|
|
|
|
# change logs commonly have long URLs we shouldn't break, and by default |
59
|
|
|
|
|
|
|
# Text::Wrap wraps on NONBREAKING SPACE. |
60
|
22
|
|
|
|
|
26
|
local $Text::Wrap::break = '[\t ]'; |
61
|
22
|
|
|
|
|
21
|
local $Text::Wrap::huge = 'overflow'; |
62
|
22
|
|
|
|
|
18
|
$output .= Text::Wrap::wrap( ' - ', ' ', $_ ) . "\n" for @{ $self->changes }; |
|
22
|
|
|
|
|
37
|
|
63
|
|
|
|
|
|
|
|
64
|
22
|
|
|
|
|
21496
|
return $output; |
65
|
|
|
|
|
|
|
} |
66
|
|
|
|
|
|
|
|
67
|
|
|
|
|
|
|
1; |
68
|
|
|
|
|
|
|
|
69
|
|
|
|
|
|
|
__END__ |