| line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
|
1
|
|
|
|
|
|
|
package CPAN::Packager::Config::Loader; |
|
2
|
1
|
|
|
1
|
|
5
|
use Mouse; |
|
|
1
|
|
|
|
|
2
|
|
|
|
1
|
|
|
|
|
10
|
|
|
3
|
1
|
|
|
1
|
|
509
|
use YAML; |
|
|
1
|
|
|
|
|
3
|
|
|
|
1
|
|
|
|
|
71
|
|
|
4
|
1
|
|
|
1
|
|
1260
|
use Encode; |
|
|
1
|
|
|
|
|
32688
|
|
|
|
1
|
|
|
|
|
105
|
|
|
5
|
1
|
|
|
1
|
|
543
|
use CPAN::Packager::Config::Validator; |
|
|
1
|
|
|
|
|
4
|
|
|
|
1
|
|
|
|
|
226
|
|
|
6
|
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
sub load { |
|
8
|
0
|
|
|
0
|
0
|
|
my ($self,$filename) = @_; |
|
9
|
0
|
|
|
|
|
|
my $config = YAML::LoadFile($filename); |
|
10
|
0
|
|
|
|
|
|
CPAN::Packager::Config::Validator->validate($config); |
|
11
|
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
# FIXME: refactor it. |
|
13
|
|
|
|
|
|
|
|
|
14
|
0
|
0
|
|
|
|
|
if ( $config->{global}->{fix_module_name} ) { |
|
15
|
0
|
|
|
|
|
|
my $fix_module_map = {}; |
|
16
|
0
|
|
|
|
|
|
my $fix_module_name = $config->{global}->{fix_module_name}; |
|
17
|
0
|
|
|
|
|
|
for my $conf ( @{ $fix_module_name } ) { |
|
|
0
|
|
|
|
|
|
|
|
18
|
0
|
|
|
|
|
|
$fix_module_map->{ $conf->{from} } = $conf->{to}; |
|
19
|
|
|
|
|
|
|
} |
|
20
|
|
|
|
|
|
|
|
|
21
|
0
|
|
|
|
|
|
$config->{global}->{fix_module_name} = $fix_module_map; |
|
22
|
|
|
|
|
|
|
} |
|
23
|
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
# change array to hash for speed. |
|
25
|
0
|
0
|
|
|
|
|
if ( $config->{modules} ) { |
|
26
|
0
|
|
|
|
|
|
my $modules = $config->{modules}; |
|
27
|
0
|
|
|
|
|
|
my $module_of = {}; |
|
28
|
0
|
|
|
|
|
|
for my $mod ( @{ $modules } ) { |
|
|
0
|
|
|
|
|
|
|
|
29
|
0
|
|
|
|
|
|
$module_of->{$mod->{module}} = $mod; |
|
30
|
|
|
|
|
|
|
} |
|
31
|
0
|
|
|
|
|
|
$config->{modules} = $module_of; |
|
32
|
|
|
|
|
|
|
} |
|
33
|
|
|
|
|
|
|
|
|
34
|
0
|
|
|
|
|
|
$config; |
|
35
|
|
|
|
|
|
|
} |
|
36
|
|
|
|
|
|
|
|
|
37
|
1
|
|
|
1
|
|
8
|
no Mouse; |
|
|
1
|
|
|
|
|
2
|
|
|
|
1
|
|
|
|
|
12
|
|
|
38
|
|
|
|
|
|
|
__PACKAGE__->meta->make_immutable; |
|
39
|
|
|
|
|
|
|
1; |
|
40
|
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
__END__ |