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