line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package CPAN::Changes::Group; |
2
|
16
|
|
|
16
|
|
81662
|
use strict; |
|
16
|
|
|
|
|
38
|
|
|
16
|
|
|
|
|
520
|
|
3
|
16
|
|
|
16
|
|
85
|
use warnings; |
|
16
|
|
|
|
|
31
|
|
|
16
|
|
|
|
|
1060
|
|
4
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
our $VERSION = '0.500_001'; |
6
|
|
|
|
|
|
|
$VERSION =~ tr/_//d; |
7
|
|
|
|
|
|
|
|
8
|
16
|
|
|
16
|
|
570
|
use Sub::Quote qw(qsub); |
|
16
|
|
|
|
|
4838
|
|
|
16
|
|
|
|
|
817
|
|
9
|
16
|
|
|
16
|
|
512
|
use CPAN::Changes::Entry; |
|
16
|
|
|
|
|
38
|
|
|
16
|
|
|
|
|
530
|
|
10
|
|
|
|
|
|
|
|
11
|
16
|
|
|
16
|
|
103
|
use Moo; |
|
16
|
|
|
|
|
42
|
|
|
16
|
|
|
|
|
157
|
|
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
has _entry => ( |
14
|
|
|
|
|
|
|
is => 'rw', |
15
|
|
|
|
|
|
|
handles => { |
16
|
|
|
|
|
|
|
is_empty => 'has_entries', |
17
|
|
|
|
|
|
|
add_changes => 'add_entry', |
18
|
|
|
|
|
|
|
name => 'text', |
19
|
|
|
|
|
|
|
}, |
20
|
|
|
|
|
|
|
lazy => 1, |
21
|
|
|
|
|
|
|
default => qsub q{ CPAN::Changes::Entry->new(text => '') }, |
22
|
|
|
|
|
|
|
predicate => 1, |
23
|
|
|
|
|
|
|
); |
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
sub _maybe_entry { |
26
|
2
|
|
|
2
|
|
3
|
my $self = shift; |
27
|
2
|
50
|
|
|
|
17
|
if ($self->can('changes') == \&changes) { |
28
|
2
|
|
|
|
|
38
|
return $self->_entry; |
29
|
|
|
|
|
|
|
} |
30
|
|
|
|
|
|
|
else { |
31
|
0
|
|
|
|
|
0
|
return CPAN::Changes::Entry->new( |
32
|
|
|
|
|
|
|
text => $self->name, |
33
|
|
|
|
|
|
|
entries => $self->changes, |
34
|
|
|
|
|
|
|
); |
35
|
|
|
|
|
|
|
} |
36
|
|
|
|
|
|
|
} |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
around BUILDARGS => sub { |
39
|
|
|
|
|
|
|
my ($orig, $self, @args) = @_; |
40
|
|
|
|
|
|
|
my $args = $self->$orig(@args); |
41
|
|
|
|
|
|
|
if (!$args->{_entry}) { |
42
|
|
|
|
|
|
|
$args->{_entry} = CPAN::Changes::Entry->new({ |
43
|
|
|
|
|
|
|
text => $args->{name} || '', |
44
|
|
|
|
|
|
|
entries => $args->{changes} || [], |
45
|
|
|
|
|
|
|
}); |
46
|
|
|
|
|
|
|
} |
47
|
|
|
|
|
|
|
$args; |
48
|
|
|
|
|
|
|
}; |
49
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
sub changes { |
51
|
34
|
|
|
34
|
1
|
474
|
my ($self) = @_; |
52
|
34
|
50
|
|
|
|
179
|
return [] |
53
|
|
|
|
|
|
|
unless $self->_has_entry; |
54
|
34
|
|
|
|
|
65
|
[ map { $_->text } @{ $self->_entry->entries } ]; |
|
36
|
|
|
|
|
1340
|
|
|
34
|
|
|
|
|
568
|
|
55
|
|
|
|
|
|
|
} |
56
|
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
sub set_changes { |
58
|
0
|
|
|
0
|
1
|
|
my ($self, @changes) = @_; |
59
|
0
|
|
|
|
|
|
my $entry = $self->_entry->clone(entries => \@changes); |
60
|
0
|
|
|
|
|
|
$self->_entry($entry); |
61
|
|
|
|
|
|
|
} |
62
|
|
|
|
|
|
|
|
63
|
|
|
|
|
|
|
sub clear_changes { |
64
|
0
|
|
|
0
|
1
|
|
my ($self) = @_; |
65
|
0
|
|
|
|
|
|
my $entry = $self->_entry; |
66
|
0
|
|
|
|
|
|
@{$entry->entries} = (); |
|
0
|
|
|
|
|
|
|
67
|
0
|
|
|
|
|
|
$self->changes; |
68
|
|
|
|
|
|
|
} |
69
|
|
|
|
|
|
|
|
70
|
|
|
|
|
|
|
sub serialize { |
71
|
0
|
|
|
0
|
1
|
|
my ($self, %args) = @_; |
72
|
0
|
|
0
|
|
|
|
$args{indents} ||= [' ', ' ']; |
73
|
0
|
|
0
|
|
|
|
$args{styles} ||= ['[]', '-']; |
74
|
0
|
|
|
|
|
|
$self->_maybe_entry->serialize(%args); |
75
|
|
|
|
|
|
|
} |
76
|
|
|
|
|
|
|
|
77
|
|
|
|
|
|
|
1; |
78
|
|
|
|
|
|
|
__END__ |