blib/lib/Thunderhorse/Config.pm

filter: Statementstmt 100% 20 / 20 Branchbran 100% 4 / 4 Conditioncond 66.6% 2 / 3 MC/DCmcdc 0.0% 0 / 2 Subroutinesub 100% 4 / 4 Podpod 100% 1 / 1 totaltotal 91.1% 31 / 34 CC 7 SCAR 16.5
CC
7
Cov
96%
load_from_files
7.0
BEGIN
1.0
BEGIN
1.0
CRAP 5.2
« blib/lib/Thunderhorse.pm ↑ Summary blib/lib/Thunderhorse/Router/SpecializedCache.pm »
1 package Thunderhorse::Config;
2 24 $Thunderhorse::Config::VERSION = '0.107';
3 24 ▶use v5.40;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 24 ▶use Mooish::Base -standard;
Subroutine BEGIN: called CC=1 SCAR=0.0
5  
6 24 ▶use Path::Tiny qw(path);
Subroutine BEGIN: called CC=1 SCAR=0.0
7  
8 24 extends 'Gears::Config';
9  
10 9 ▶sub load_from_files ($self, $conf_dir, $env = undef)
Subroutine load_from_files: called CC=7 SCAR=19.5
Pod documented
11 9 {
12 9 $conf_dir = path($conf_dir);
13 9 ▶ return unless -d $conf_dir;
Branch: 1 branch
BranchTrueFalseTotal
unless -d $conf_dir 1 8 9
14  
15 8 my @extensions = map { $_->handled_extensions } $self->readers->@*;
16  
17 8 ▶ foreach my $base_name ('config', $env // ()) {
Condition66%2/3
$env // ()
l!l&&r!l&&!r
710
MC/DC0%0/2
$env // ()
$env ()
Truth table66%2/3
A // B
A= $envB= ()
ABresult
1X1
011
000
18 15 foreach my $ext (@extensions) {
19 18 my $file = $conf_dir->child("$base_name.$ext");
20 18 ▶ $self->add(file => "$file")
Branch: 1 branch
BranchTrueFalseTotal
if -f $file 15 3 18
21 if -f $file;
22 }
23 }
24  
25 8 return;
26 }
27  
28 __END__
« blib/lib/Thunderhorse.pm ↑ Summary blib/lib/Thunderhorse/Router/SpecializedCache.pm »