line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
$PAUSE::Packages::ReleaseIterator::VERSION = '0.18'; |
2
|
|
|
|
|
|
|
use 5.8.1; |
3
|
2
|
|
|
2
|
|
52
|
use Moo 1.006; |
|
2
|
|
|
|
|
8
|
|
4
|
2
|
|
|
2
|
|
12
|
use PAUSE::Packages; |
|
2
|
|
|
|
|
33
|
|
|
2
|
|
|
|
|
16
|
|
5
|
2
|
|
|
2
|
|
671
|
use PAUSE::Packages::Release; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
52
|
|
6
|
2
|
|
|
2
|
|
10
|
use PAUSE::Packages::Module; |
|
2
|
|
|
|
|
5
|
|
|
2
|
|
|
|
|
43
|
|
7
|
2
|
|
|
2
|
|
9
|
use JSON::MaybeXS; |
|
2
|
|
|
|
|
13
|
|
|
2
|
|
|
|
|
61
|
|
8
|
2
|
|
|
2
|
|
12
|
use autodie 2.29; |
|
2
|
|
|
|
|
3
|
|
|
2
|
|
|
|
|
159
|
|
9
|
2
|
|
|
2
|
|
13
|
|
|
2
|
|
|
|
|
46
|
|
|
2
|
|
|
|
|
19
|
|
10
|
|
|
|
|
|
|
has 'packages' => |
11
|
|
|
|
|
|
|
( |
12
|
|
|
|
|
|
|
is => 'ro', |
13
|
|
|
|
|
|
|
default => sub { return PAUSE::Packages->new(); }, |
14
|
|
|
|
|
|
|
); |
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
has 'well_formed' => |
17
|
|
|
|
|
|
|
( |
18
|
|
|
|
|
|
|
is => 'ro', |
19
|
|
|
|
|
|
|
default => sub { 0 }, |
20
|
|
|
|
|
|
|
); |
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
has _fh => ( is => 'rw' ); |
23
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
{ |
25
|
|
|
|
|
|
|
my $self = shift; |
26
|
|
|
|
|
|
|
my @modules; |
27
|
7
|
|
|
7
|
0
|
3913
|
my $fh; |
28
|
7
|
|
|
|
|
14
|
|
29
|
|
|
|
|
|
|
if (not defined $self->_fh) { |
30
|
|
|
|
|
|
|
open($fh, '<', $self->packages->path()); |
31
|
7
|
100
|
|
|
|
31
|
my $inheader = 1; |
32
|
2
|
|
|
|
|
49
|
|
33
|
2
|
|
|
|
|
5120
|
# Skip the header block at the top of the file |
34
|
|
|
|
|
|
|
while (<$fh>) { |
35
|
|
|
|
|
|
|
last if /^$/; |
36
|
2
|
|
|
|
|
76
|
} |
37
|
6
|
100
|
|
|
|
30
|
$self->_fh($fh); |
38
|
|
|
|
|
|
|
} |
39
|
2
|
|
|
|
|
12
|
else { |
40
|
|
|
|
|
|
|
$fh = $self->_fh; |
41
|
|
|
|
|
|
|
} |
42
|
5
|
|
|
|
|
12
|
|
43
|
|
|
|
|
|
|
RELEASE: |
44
|
|
|
|
|
|
|
while (1) { |
45
|
|
|
|
|
|
|
my $line = <$fh>; |
46
|
7
|
|
|
|
|
11
|
my @args; |
47
|
8
|
|
|
|
|
68
|
|
48
|
8
|
|
|
|
|
17
|
if (defined($line)) { |
49
|
|
|
|
|
|
|
chomp($line); |
50
|
8
|
100
|
|
|
|
21
|
my ($path, $json) = split(/\s+/, $line, 2); |
51
|
6
|
|
|
|
|
15
|
foreach my $entry (@{ decode_json($json) }) { |
52
|
6
|
|
|
|
|
36
|
my $module = PAUSE::Packages::Module->new( |
53
|
6
|
|
|
|
|
10
|
name => $entry->[0], |
|
6
|
|
|
|
|
46
|
|
54
|
8
|
|
|
|
|
117
|
version => $entry->[1], |
55
|
|
|
|
|
|
|
); |
56
|
|
|
|
|
|
|
push(@modules, $module); |
57
|
|
|
|
|
|
|
} |
58
|
8
|
|
|
|
|
2324
|
@args = (modules => [@modules], path => $path); |
59
|
|
|
|
|
|
|
if ($self->well_formed) { |
60
|
6
|
|
|
|
|
21
|
my $distinfo = CPAN::DistnameInfo->new($path); |
61
|
6
|
100
|
|
|
|
25
|
next RELEASE unless defined($distinfo) |
62
|
3
|
|
|
|
|
17
|
&& defined($distinfo->dist) |
63
|
3
|
100
|
66
|
|
|
196
|
&& defined($distinfo->cpanid); |
|
|
|
66
|
|
|
|
|
64
|
|
|
|
|
|
|
push(@args, distinfo => $distinfo); |
65
|
|
|
|
|
|
|
} |
66
|
2
|
|
|
|
|
32
|
return PAUSE::Packages::Release->new(@args); |
67
|
|
|
|
|
|
|
} else { |
68
|
5
|
|
|
|
|
59
|
return undef; |
69
|
|
|
|
|
|
|
} |
70
|
2
|
|
|
|
|
12
|
} |
71
|
|
|
|
|
|
|
|
72
|
|
|
|
|
|
|
return undef; |
73
|
|
|
|
|
|
|
} |
74
|
0
|
|
|
|
|
|
|
75
|
|
|
|
|
|
|
1; |