line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
2
|
|
|
2
|
|
909
|
use 5.006; |
|
2
|
|
|
|
|
8
|
|
2
|
2
|
|
|
2
|
|
10
|
use strict; |
|
2
|
|
|
|
|
29
|
|
|
2
|
|
|
|
|
58
|
|
3
|
2
|
|
|
2
|
|
7
|
use warnings; |
|
2
|
|
|
|
|
3
|
|
|
2
|
|
|
|
|
165
|
|
4
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
package CPAN::Distribution::ReleaseHistory::ReleaseIterator; |
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
our $VERSION = '0.002004'; |
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
# ABSTRACT: A container to iterate a collection of releases for a single distribution |
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
our $AUTHORITY = 'cpan:KENTNL'; # AUTHORITY |
12
|
|
|
|
|
|
|
|
13
|
2
|
|
|
2
|
|
539
|
use Moo qw( has ); |
|
2
|
|
|
|
|
12932
|
|
|
2
|
|
|
|
|
21
|
|
14
|
2
|
|
|
2
|
|
4088
|
use CPAN::DistnameInfo; |
|
2
|
|
|
|
|
2710
|
|
|
2
|
|
|
|
|
92
|
|
15
|
2
|
|
|
2
|
|
1301
|
use CPAN::Distribution::ReleaseHistory::Release; |
|
2
|
|
|
|
|
7
|
|
|
2
|
|
|
|
|
623
|
|
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
has 'scroller' => ( is => 'ro', required => 1 ); |
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
sub next_release { |
34
|
13
|
|
|
13
|
1
|
37246
|
my ($self) = @_; |
35
|
13
|
|
|
|
|
81
|
my $scroll_result = $self->scroller->next; |
36
|
13
|
50
|
|
|
|
281
|
return if not $scroll_result; |
37
|
|
|
|
|
|
|
|
38
|
13
|
|
33
|
|
|
62
|
my $data_hash = $scroll_result->{'_source'} || $scroll_result->{'fields'}; |
39
|
13
|
50
|
|
|
|
34
|
return if not $data_hash; |
40
|
|
|
|
|
|
|
|
41
|
13
|
|
|
|
|
25
|
my $path = $data_hash->{download_url}; |
42
|
13
|
|
|
|
|
142
|
$path =~ s{\A.*/authors/id/}{}msx; |
43
|
13
|
|
|
|
|
55
|
my $distinfo = CPAN::DistnameInfo->new($path); |
44
|
|
|
|
|
|
|
my $distname = |
45
|
|
|
|
|
|
|
defined($distinfo) && defined( $distinfo->dist ) |
46
|
|
|
|
|
|
|
? $distinfo->dist |
47
|
13
|
50
|
33
|
|
|
1185
|
: $data_hash->{name}; |
48
|
|
|
|
|
|
|
return CPAN::Distribution::ReleaseHistory::Release->new( |
49
|
|
|
|
|
|
|
distname => $distname, |
50
|
|
|
|
|
|
|
path => $path, |
51
|
|
|
|
|
|
|
timestamp => $data_hash->{stat}->{mtime}, |
52
|
|
|
|
|
|
|
size => $data_hash->{stat}->{size}, |
53
|
13
|
|
|
|
|
1719
|
); |
54
|
|
|
|
|
|
|
} |
55
|
|
|
|
|
|
|
|
56
|
2
|
|
|
2
|
|
20
|
no Moo; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
13
|
|
57
|
|
|
|
|
|
|
|
58
|
|
|
|
|
|
|
1; |
59
|
|
|
|
|
|
|
|
60
|
|
|
|
|
|
|
__END__ |