line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
4
|
|
|
4
|
|
17541
|
use v5.14.0; |
|
4
|
|
|
|
|
13
|
|
|
4
|
|
|
|
|
165
|
|
2
|
4
|
|
|
4
|
|
15
|
use warnings; |
|
4
|
|
|
|
|
6
|
|
|
4
|
|
|
|
|
190
|
|
3
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
package OS::Package::Config; |
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
# ABSTRACT: Load OS::Package configuration object. |
7
|
|
|
|
|
|
|
our $VERSION = '0.2.7'; # VERSION |
8
|
|
|
|
|
|
|
|
9
|
4
|
|
|
4
|
|
25
|
use base qw(Exporter); |
|
4
|
|
|
|
|
5
|
|
|
4
|
|
|
|
|
362
|
|
10
|
4
|
|
|
4
|
|
981
|
use Env qw( $HOME ); |
|
4
|
|
|
|
|
2306
|
|
|
4
|
|
|
|
|
25
|
|
11
|
4
|
|
|
4
|
|
2125
|
use File::ShareDir qw(dist_file); |
|
4
|
|
|
|
|
15222
|
|
|
4
|
|
|
|
|
278
|
|
12
|
4
|
|
|
4
|
|
2084
|
use Hash::AsObject; |
|
4
|
|
|
|
|
2676
|
|
|
4
|
|
|
|
|
24
|
|
13
|
4
|
|
|
4
|
|
2398
|
use Path::Tiny; |
|
4
|
|
|
|
|
35894
|
|
|
4
|
|
|
|
|
320
|
|
14
|
4
|
|
|
4
|
|
1684
|
use YAML::Any qw( LoadFile ); |
|
4
|
|
|
|
|
3525
|
|
|
4
|
|
|
|
|
20
|
|
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
our @EXPORT = qw( $OSPKG_CONFIG ); |
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
local $YAML::UseCode = 0 if !defined $YAML::UseCode; |
19
|
|
|
|
|
|
|
local $YAML::LoadCode = 0 if !defined $YAML::LoadCode; |
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
our $OSPKG_CONFIG = Hash::AsObject->new( |
22
|
|
|
|
|
|
|
LoadFile( dist_file( 'OS-Package', 'config.yml' ) ) ); |
23
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
if ( path( $OSPKG_CONFIG->user_config )->exists ) { |
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
my $user_config = LoadFile( path( $OSPKG_CONFIG->user_config ) ); |
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
if ( defined $user_config->{config_dir} ) { |
29
|
|
|
|
|
|
|
$OSPKG_CONFIG->dir->configs($user_config->{config_dir}); |
30
|
|
|
|
|
|
|
} |
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
if ( defined $user_config->{pkg_dir} ) { |
33
|
|
|
|
|
|
|
$OSPKG_CONFIG->dir->packages($user_config->{pkg_dir}); |
34
|
|
|
|
|
|
|
} |
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
} |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
1; |
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
__END__ |