line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Class::Component::Component::Plaggerize::ConfigLoader; |
2
|
1
|
|
|
1
|
|
7
|
use strict; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
50
|
|
3
|
1
|
|
|
1
|
|
6
|
use warnings; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
31
|
|
4
|
|
|
|
|
|
|
|
5
|
1
|
|
|
1
|
|
6
|
use YAML (); |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
136
|
|
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
sub setup_config { |
8
|
1
|
|
|
1
|
0
|
2
|
my $class = shift; |
9
|
1
|
|
|
|
|
4
|
my($config_file) = @_; |
10
|
|
|
|
|
|
|
|
11
|
1
|
|
|
|
|
6
|
my $config = $class->NEXT( setup_config => @_ ); |
12
|
1
|
|
50
|
|
|
16
|
$config_file = $config || $config_file || {}; |
13
|
1
|
50
|
|
|
|
269
|
return $config_file if ref($config_file); |
14
|
|
|
|
|
|
|
|
15
|
0
|
0
|
|
|
|
|
open my $fh, '<:utf8', $config_file or die $!; |
16
|
0
|
|
|
|
|
|
$config = YAML::LoadFile($fh); |
17
|
0
|
|
|
|
|
|
close $fh; |
18
|
|
|
|
|
|
|
|
19
|
0
|
|
|
|
|
|
$config; |
20
|
|
|
|
|
|
|
} |
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
1; |