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