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   469671 use 5.014;
  2         7  
5 2     2   753 use exact;
  2         41501  
  2         55  
6              
7             our $VERSION = '1.09'; # VERSION
8              
9             sub import {
10 1     1   25 my ( $self, $params, $caller ) = @_;
11 1   33     4 $caller //= caller();
12              
13 1   50     8 my @params = grep { length } split( /[,\s]+/, $params || '' );
  0         0  
14              
15 1         765 require Config::App;
16 1 50 33     128384 Config::App->import(@params) if ( @params or not length $params );
17              
18             {
19 2     2   5144 no strict 'refs';
  2         5  
  2         566  
  1         12151  
20 1         4 my $method = 'conf';
21 1 50       2 *{ $caller . '::' . $method } = \&$method unless ( defined &{ $caller . '::' . $method } );
  1         15  
  1         12  
22             }
23             }
24              
25             sub conf {
26 1     1 1 337835 shift;
27 1         22 return Config::App->new(@_);
28             }
29              
30             1;
31              
32             __END__