line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package CPAN::Changes::Group; |
2
|
|
|
|
|
|
|
|
3
|
23
|
|
|
23
|
|
42610
|
use strict; |
|
23
|
|
|
|
|
34
|
|
|
23
|
|
|
|
|
866
|
|
4
|
23
|
|
|
23
|
|
129
|
use warnings; |
|
23
|
|
|
|
|
32
|
|
|
23
|
|
|
|
|
564
|
|
5
|
|
|
|
|
|
|
|
6
|
23
|
|
|
23
|
|
594
|
use Text::Wrap (); |
|
23
|
|
|
|
|
3419
|
|
|
23
|
|
|
|
|
7888
|
|
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
sub new { |
9
|
88
|
|
|
88
|
1
|
25599
|
my $class = shift; |
10
|
88
|
|
|
|
|
538
|
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
|
25
|
my $self = shift; |
20
|
24
|
50
|
|
|
|
108
|
if ( not exists $self->{ name } ) { |
21
|
0
|
|
|
|
|
0
|
$self->{ name } = q[]; |
22
|
|
|
|
|
|
|
} |
23
|
24
|
|
|
|
|
41
|
return $self->{ name }; |
24
|
|
|
|
|
|
|
} |
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
sub changes { |
27
|
105
|
|
|
105
|
1
|
106
|
my $self = shift; |
28
|
105
|
|
|
|
|
534
|
return $self->{ changes }; |
29
|
|
|
|
|
|
|
} |
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
sub add_changes { |
32
|
114
|
|
|
114
|
1
|
130
|
my $self = shift; |
33
|
114
|
|
|
|
|
97
|
push @{ $self->{ changes } }, @_; |
|
114
|
|
|
|
|
545
|
|
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
|
10
|
my $self = shift; |
48
|
7
|
|
|
|
|
6
|
return !@{ $self->changes }; |
|
7
|
|
|
|
|
8
|
|
49
|
|
|
|
|
|
|
} |
50
|
|
|
|
|
|
|
|
51
|
|
|
|
|
|
|
sub serialize { |
52
|
22
|
|
|
22
|
1
|
23
|
my $self = shift; |
53
|
22
|
|
|
|
|
24
|
my %args = @_; |
54
|
|
|
|
|
|
|
|
55
|
22
|
|
|
|
|
23
|
my $output = ''; |
56
|
22
|
|
|
|
|
31
|
my $name = $self->name; |
57
|
22
|
|
|
|
|
19
|
my $indent = ' '; |
58
|
22
|
100
|
|
|
|
41
|
if (length $name) { |
59
|
14
|
50
|
|
|
|
51
|
$output .= sprintf " [ %s ]\n", $name if length $name; |
60
|
14
|
|
|
|
|
15
|
$indent .= ' '; |
61
|
|
|
|
|
|
|
} |
62
|
|
|
|
|
|
|
# change logs commonly have long URLs we shouldn't break, and by default |
63
|
|
|
|
|
|
|
# Text::Wrap wraps on NONBREAKING SPACE. |
64
|
22
|
|
|
|
|
23
|
local $Text::Wrap::break = '[\t ]'; |
65
|
22
|
|
|
|
|
56
|
local $Text::Wrap::huge = 'overflow'; |
66
|
22
|
|
|
|
|
19
|
$output .= Text::Wrap::wrap( "$indent- ", "$indent ", $_ ) . "\n" for @{ $self->changes }; |
|
22
|
|
|
|
|
30
|
|
67
|
|
|
|
|
|
|
|
68
|
22
|
|
|
|
|
21236
|
return $output; |
69
|
|
|
|
|
|
|
} |
70
|
|
|
|
|
|
|
|
71
|
|
|
|
|
|
|
1; |
72
|
|
|
|
|
|
|
|
73
|
|
|
|
|
|
|
__END__ |