File Coverage

blib/lib/exact/conf.pm
Criterion Covered Total %
statement 20 21 95.2
branch 2 4 50.0
condition 3 8 37.5
subroutine 5 5 100.0
pod 1 1 100.0
total 31 39 79.4


line stmt bran cond sub pod time code
1             package exact::conf;
2             # ABSTRACT: Cascading merged application configuration extension for exact
3              
4 2     2   437419 use 5.014;
  2         7  
5 2     2   531 use exact;
  2         42757  
  2         16  
6              
7             our $VERSION = '1.11'; # VERSION
8              
9             sub import {
10 1     1   27 my ( $self, $params, $caller ) = @_;
11 1   33     5 $caller //= caller();
12              
13 1   50     9 my @params = grep { length } split( /[,\s]+/, $params || '' );
  0         0  
14              
15 1         812 require Config::App;
16 1 50 33     102231 Config::App->import(@params) if ( @params or not length $params );
17              
18             {
19 2     2   5620 no strict 'refs';
  2         6  
  2         586  
  1         8004  
20 1         6 my $method = 'conf';
21 1 50       2 *{ $caller . '::' . $method } = \&$method unless ( defined &{ $caller . '::' . $method } );
  1         26  
  1         8  
22             }
23             }
24              
25             sub conf {
26 1     1 1 237168 shift;
27 1         11 return Config::App->new(@_);
28             }
29              
30             1;
31              
32             __END__