line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Module::cpmfile::Util; |
2
|
3
|
|
|
3
|
|
25
|
use strict; |
|
3
|
|
|
|
|
6
|
|
|
3
|
|
|
|
|
108
|
|
3
|
3
|
|
|
3
|
|
17
|
use warnings; |
|
3
|
|
|
|
|
7
|
|
|
3
|
|
|
|
|
91
|
|
4
|
|
|
|
|
|
|
|
5
|
3
|
|
|
3
|
|
18
|
use CPAN::Meta::Requirements; |
|
3
|
|
|
|
|
8
|
|
|
3
|
|
|
|
|
103
|
|
6
|
|
|
|
|
|
|
|
7
|
3
|
|
|
3
|
|
20
|
use Exporter 'import'; |
|
3
|
|
|
|
|
6
|
|
|
3
|
|
|
|
|
858
|
|
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
|
5
|
my ($v1, $v2) = @_; |
14
|
1
|
|
|
|
|
14
|
my $r = CPAN::Meta::Requirements->new; |
15
|
1
|
50
|
|
|
|
30
|
$r->add_string_requirement($TEST_PACKAGE, $v1) if defined $v1; |
16
|
1
|
50
|
|
|
|
209
|
$r->add_string_requirement($TEST_PACKAGE, $v2) if defined $v2; |
17
|
1
|
|
|
|
|
135
|
$r->requirements_for_module($TEST_PACKAGE); |
18
|
|
|
|
|
|
|
} |
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
{ |
21
|
|
|
|
|
|
|
my $YAML; |
22
|
|
|
|
|
|
|
sub _yaml_hash { |
23
|
4
|
|
|
4
|
|
10
|
my ($hash, $indent) = @_; |
24
|
4
|
|
66
|
|
|
11
|
$YAML ||= do { require YAML::PP; YAML::PP->new(header => 0) }; |
|
1
|
|
|
|
|
16
|
|
|
1
|
|
|
|
|
11
|
|
25
|
4
|
|
|
|
|
2160
|
my @string = split /\n/, $YAML->dump_string($hash); |
26
|
4
|
|
|
|
|
4167
|
map { "$indent$_" } @string; |
|
6
|
|
|
|
|
42
|
|
27
|
|
|
|
|
|
|
} |
28
|
|
|
|
|
|
|
} |
29
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
1; |