blib/lib/App/Rad/Plugin/ConfigLoader.pm

filter: Statementstmt 52.3% 11 / 21 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 75.0% 3 / 4 Podpod 100% 1 / 1 totaltotal 57.6% 15 / 26 CC 3 SCAR 18.7
CC
3
Cov
52%
load_config
12.0
BEGIN
1.0
BEGIN
1.0
CRAP 6.5
↑ Summary
1 package App::Rad::Plugin::ConfigLoader;
2 2 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
3 2 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
4  
5 2 ▶use Config::Any;
Subroutine BEGIN: called CC=1 SCAR=0.0
6  
7 2 our $VERSION = '0.01';
8  
9 0 ▶sub load_config {
Subroutine load_config: not called CC=3 SCAR=24.8
Pod documented
10 0 my ($c, @filepaths) = (@_);
11  
12 0 my $cfg = Config::Any->load_files({
13 'files' => \@filepaths,
14 'use_ext' => 1
15 });
16 0 foreach ( @{$cfg} ) {
17 0 my ($filename, $config) = %{$_};
18 0 $c->debug("loaded configuration from file '$filename'.");
19  
20 # I could just fiddle with the internals to make this
21 # a little quicker, but let's stick to the API :)
22 0 foreach my $key (keys %{$config}) {
23 0 $c->config->{$key} = $config->{$key};
24 }
25 }
26 }
27  
28 2 42;
29 __END__
↑ Summary