line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Module::cpmfile::Util; |
2
|
3
|
|
|
3
|
|
19
|
use strict; |
|
3
|
|
|
|
|
4
|
|
|
3
|
|
|
|
|
79
|
|
3
|
3
|
|
|
3
|
|
13
|
use warnings; |
|
3
|
|
|
|
|
4
|
|
|
3
|
|
|
|
|
71
|
|
4
|
|
|
|
|
|
|
|
5
|
3
|
|
|
3
|
|
11
|
use CPAN::Meta::Requirements; |
|
3
|
|
|
|
|
6
|
|
|
3
|
|
|
|
|
48
|
|
6
|
|
|
|
|
|
|
|
7
|
3
|
|
|
3
|
|
13
|
use Exporter 'import'; |
|
3
|
|
|
|
|
3
|
|
|
3
|
|
|
|
|
645
|
|
8
|
|
|
|
|
|
|
our @EXPORT_OK = qw(merge_version _yaml_hash); |
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
my $TEST_PACKAGE = '__TEST_PACKAGE__'; |
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
sub merge_version { |
13
|
1
|
|
|
1
|
0
|
3
|
my ($v1, $v2) = @_; |
14
|
1
|
|
|
|
|
10
|
my $r = CPAN::Meta::Requirements->new; |
15
|
1
|
50
|
|
|
|
21
|
$r->add_string_requirement($TEST_PACKAGE, $v1) if defined $v1; |
16
|
1
|
50
|
|
|
|
146
|
$r->add_string_requirement($TEST_PACKAGE, $v2) if defined $v2; |
17
|
1
|
|
|
|
|
96
|
$r->requirements_for_module($TEST_PACKAGE); |
18
|
|
|
|
|
|
|
} |
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
{ |
21
|
|
|
|
|
|
|
my $YAML; |
22
|
|
|
|
|
|
|
sub _yaml_hash { |
23
|
4
|
|
|
4
|
|
9
|
my ($hash, $indent) = @_; |
24
|
4
|
|
66
|
|
|
8
|
$YAML ||= do { require YAML::PP; YAML::PP->new(header => 0) }; |
|
1
|
|
|
|
|
8
|
|
|
1
|
|
|
|
|
7
|
|
25
|
4
|
|
|
|
|
1600
|
my @string = split /\n/, $YAML->dump_string($hash); |
26
|
4
|
|
|
|
|
2764
|
map { "$indent$_" } @string; |
|
6
|
|
|
|
|
25
|
|
27
|
|
|
|
|
|
|
} |
28
|
|
|
|
|
|
|
} |
29
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
1; |