line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
2
|
|
|
2
|
|
597
|
use 5.006; |
|
2
|
|
|
|
|
6
|
|
|
2
|
|
|
|
|
71
|
|
2
|
2
|
|
|
2
|
|
8
|
use strict; |
|
2
|
|
|
|
|
2
|
|
|
2
|
|
|
|
|
48
|
|
3
|
2
|
|
|
2
|
|
7
|
use warnings; |
|
2
|
|
|
|
|
2
|
|
|
2
|
|
|
|
|
102
|
|
4
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
package Gentoo::Util::MetaCPAN::Release; |
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
our $VERSION = '0.001000'; # TRIAL |
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
# ABSTRACT: Subclass of MetaCPAN::Client::Release with some utility functions |
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
our $AUTHORITY = 'cpan:KENTNL'; # AUTHORITY |
12
|
|
|
|
|
|
|
|
13
|
2
|
|
|
2
|
|
469
|
use Moo qw( extends has around ); |
|
2
|
|
|
|
|
12261
|
|
|
2
|
|
|
|
|
15
|
|
14
|
2
|
|
|
2
|
|
2522
|
use Gentoo::PerlMod::Version qw( gentooize_version ); |
|
2
|
|
|
|
|
6729
|
|
|
2
|
|
|
|
|
9
|
|
15
|
2
|
|
|
2
|
|
960
|
use Gentoo::Util::MetaCPAN::Requirement; |
|
2
|
|
|
|
|
5
|
|
|
2
|
|
|
|
|
56
|
|
16
|
2
|
|
|
2
|
|
1047
|
use CPAN::Meta::Prereqs; |
|
2
|
|
|
|
|
10592
|
|
|
2
|
|
|
|
|
53
|
|
17
|
2
|
|
|
2
|
|
840
|
use MetaCPAN::Client::Release 1.007001; |
|
2
|
|
|
|
|
26239
|
|
|
2
|
|
|
|
|
72
|
|
18
|
2
|
|
|
2
|
|
480
|
use MetaCPAN::Client::ResultSet; |
|
2
|
|
|
|
|
2435
|
|
|
2
|
|
|
|
|
506
|
|
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
extends 'MetaCPAN::Client::Release'; |
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
has 'prereqs' => ( is => ro =>, lazy => 1, builder => '_build_prereqs' ); |
23
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
sub _build_prereqs { |
25
|
0
|
|
|
0
|
|
|
my ($self) = @_; |
26
|
0
|
0
|
|
|
|
|
if ( exists $self->metadata->{prereqs} ) { |
27
|
0
|
|
|
|
|
|
return CPAN::Meta::Prereqs->new( $self->metadata->{prereqs} ); |
28
|
|
|
|
|
|
|
} |
29
|
0
|
|
|
|
|
|
my $pre = CPAN::Meta::Prereqs->new(); |
30
|
|
|
|
|
|
|
|
31
|
0
|
|
|
|
|
|
for my $dependency ( @{ $self->{data}->{dependency} } ) { |
|
0
|
|
|
|
|
|
|
32
|
0
|
|
|
|
|
|
my $stash = $pre->requirements_for( $dependency->{phase}, $dependency->{relationship} ); |
33
|
0
|
|
|
|
|
|
$stash->add_string_requirement( $dependency->{module}, $dependency->{version} ); |
34
|
|
|
|
|
|
|
} |
35
|
0
|
|
|
|
|
|
return $pre; |
36
|
|
|
|
|
|
|
} |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
sub get_dependencies { |
39
|
0
|
|
|
0
|
1
|
|
my ( $self, $phases, $relationships ) = @_; |
40
|
0
|
|
|
|
|
|
my $req = $self->prereqs->merged_requirements( $phases, $relationships ); |
41
|
0
|
|
|
|
|
|
my @out; |
42
|
0
|
|
|
|
|
|
for my $module ( sort $req->required_modules ) { |
43
|
0
|
|
|
|
|
|
push @out, |
44
|
|
|
|
|
|
|
Gentoo::Util::MetaCPAN::Requirement->new( |
45
|
|
|
|
|
|
|
module => $module, |
46
|
|
|
|
|
|
|
range => $req->{requirements}->{$module}, |
47
|
|
|
|
|
|
|
); |
48
|
|
|
|
|
|
|
} |
49
|
0
|
|
|
|
|
|
return \@out; |
50
|
|
|
|
|
|
|
} |
51
|
|
|
|
|
|
|
|
52
|
|
|
|
|
|
|
sub gentoo_version { |
53
|
0
|
|
|
0
|
1
|
|
my ($self) = @_; |
54
|
|
|
|
|
|
|
## no critic (ErrorHandling::RequireCheckingReturnValueOfEval) |
55
|
0
|
|
|
|
|
|
return eval { gentooize_version( $self->version, { lax => 1 } ) }; |
|
0
|
|
|
|
|
|
|
56
|
|
|
|
|
|
|
} |
57
|
|
|
|
|
|
|
|
58
|
2
|
|
|
2
|
|
11
|
no Moo; |
|
2
|
|
|
|
|
3
|
|
|
2
|
|
|
|
|
8
|
|
59
|
|
|
|
|
|
|
|
60
|
|
|
|
|
|
|
1; |
61
|
|
|
|
|
|
|
|
62
|
|
|
|
|
|
|
__END__ |
63
|
|
|
|
|
|
|
|
64
|
|
|
|
|
|
|
=pod |
65
|
|
|
|
|
|
|
|
66
|
|
|
|
|
|
|
=encoding UTF-8 |
67
|
|
|
|
|
|
|
|
68
|
|
|
|
|
|
|
=head1 NAME |
69
|
|
|
|
|
|
|
|
70
|
|
|
|
|
|
|
Gentoo::Util::MetaCPAN::Release - Subclass of MetaCPAN::Client::Release with some utility functions |
71
|
|
|
|
|
|
|
|
72
|
|
|
|
|
|
|
=head1 VERSION |
73
|
|
|
|
|
|
|
|
74
|
|
|
|
|
|
|
version 0.001000 |
75
|
|
|
|
|
|
|
|
76
|
|
|
|
|
|
|
=head1 METHODS |
77
|
|
|
|
|
|
|
|
78
|
|
|
|
|
|
|
=head2 gentoo_version |
79
|
|
|
|
|
|
|
|
80
|
|
|
|
|
|
|
=head2 get_dependencies |
81
|
|
|
|
|
|
|
|
82
|
|
|
|
|
|
|
=head1 AUTHOR |
83
|
|
|
|
|
|
|
|
84
|
|
|
|
|
|
|
Kent Fredric <kentnl@cpan.org> |
85
|
|
|
|
|
|
|
|
86
|
|
|
|
|
|
|
=head1 COPYRIGHT AND LICENSE |
87
|
|
|
|
|
|
|
|
88
|
|
|
|
|
|
|
This software is copyright (c) 2014 by Kent Fredric <kentfredric@gmail.com>. |
89
|
|
|
|
|
|
|
|
90
|
|
|
|
|
|
|
This is free software; you can redistribute it and/or modify it under |
91
|
|
|
|
|
|
|
the same terms as the Perl 5 programming language system itself. |
92
|
|
|
|
|
|
|
|
93
|
|
|
|
|
|
|
=cut |