Mvalve/CLI/ConfigFromFile.pm

filter: Statementstmt 72.2% 13 / 18 Branchbran 0.0% 0 / 2 Conditioncond 0.0% 0 / 3 MC/DCmcdc 0.0% 0 / 2 Subroutinesub 75.0% 3 / 4 Podpod 0.0% 0 / 1 totaltotal 53.3% 16 / 30 CC 3 SCAR 18.7
CC
3
Cov
57%
get_config_from_file
12.0
BEGIN
1.0
BEGIN
1.0
CRAP 6.5
« Mvalve/Writer.pm ↑ Summary Mvalve/QueueSet.pm »
1 # $Id: /mirror/coderepos/lang/perl/Mvalve/trunk/lib/Mvalve/CLI/ConfigFromFile.pm 66262 2008-07-16T05:50:26.279608Z daisuke $
2  
3 package Mvalve::CLI::ConfigFromFile;
4 1 ▶use Moose::Role;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 1 ▶use Config::Any;
Subroutine BEGIN: called CC=1 SCAR=0.0
6  
7 1 with 'MooseX::Getopt';
8 1 with 'MooseX::ConfigFromFile';
9  
10 1 requires 'run';
11  
12 1 ▶no Moose;
Subroutine BEGIN: called CC=1 SCAR=0.0
13  
14 0 ▶sub get_config_from_file {
Subroutine get_config_from_file: not called CC=3 SCAR=24.8
Pod undocumented
15 0 my( $class, $file ) = @_;
16  
17 0 ▶ if (! $file || ! -f $file) {
Branch: 1 branch
BranchTrueFalseTotal
unless ($file and -f $file) 0 0 0
Condition0%0/3
$file and -f $file
!ll&&!rl&&r
000
MC/DC0%0/2
$file and -f $file
$file -f $file
Truth table0%0/3
A and B
A= $fileB= -f $file
ABresult
0X0
100
111
18 0 return {};
19 }
20  
21 0 my $cfg = Config::Any->load_files({
22 files => [ $file ],
23 use_ext => 1,
24 driver_args => {
25 General => {
26 -LowerCaseNames => 1
27 }
28 }
29 });
30  
31 0 return $cfg->[0]->{$file} or die "Could not load $file";
32 }
33  
34 1 1;
« Mvalve/Writer.pm ↑ Summary Mvalve/QueueSet.pm »