File Coverage

blib/lib/exact/conf.pm
Criterion Covered Total %
statement 23 24 95.8
branch 2 4 50.0
condition 3 8 37.5
subroutine 6 6 100.0
pod 1 1 100.0
total 35 43 81.4


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