blib/lib/Clustericious/Command/configdump.pm

filter: Statementstmt 63.6% 21 / 33 Branchbran 0.0% 0 / 4 Conditioncond 0.0% 0 / 2 MC/DCmcdc 0.0% 0 / 1 Subroutinesub 75.0% 6 / 8 Podpod 100% 1 / 1 totaltotal 57.1% 28 / 49 CC 4 SCAR 15.9
CC
4
Cov
54%
run
12.0
__ANON__
6.0
BEGIN
1.0
CRAP 4.9
« blib/lib/Clustericious/Command/daemon.pm ↑ Summary blib/lib/Test/Clustericious/Config.pm »
1 package Clustericious::Command::configdump;
2
3 1 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 1 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 1 ▶use 5.010001;
Subroutine BEGIN: called CC=1 SCAR=0.0
6 1 ▶use Mojo::Base 'Clustericious::Command';
Subroutine BEGIN: called CC=1 SCAR=0.0
7 1 ▶use Clustericious::Config;
Subroutine BEGIN: called CC=1 SCAR=0.0
8 1 ▶use YAML::XS qw( Dump );
Subroutine BEGIN: called CC=1 SCAR=0.0
9  
10 # ABSTRACT: Dump a clustericious configuration
11 1 our $VERSION = '1.29'; # VERSION
12  
13  
14 1 has description => <<EOT;
15 Dump clustericious configuration
16 EOT
17  
18 1 has usage => <<EOT;
19 usage $0: configdump [ app ]
20 EOT
21  
22 sub run
23 0 ▶{
Subroutine run: not called CC=3 SCAR=24.8
Pod documented
24 0 my($self, $name) = @_;
25 0 ▶ my $app_name = $name // ref($self->app);
Condition0%0/2
$name // ref $self->app
l!l
00
MC/DC0%0/1
$name // ref $self->app
$name
Truth table0%0/2
A
A= $name
Aresult
11
00
26  
27 0 my $config = eval {
28 0 ▶ Clustericious::Config->new($app_name, sub {
Subroutine __ANON__: not called CC=2 SCAR=17.9
29 0 my($type, $name) = @_;
30 0 ▶ if($type eq 'not_found')
Branch: 1 branch
BranchTrueFalseTotal
if ($type eq "not_found") 0 0 0
31 {
32 0 say STDERR "ERROR: unable to find $name";
33 0 exit 2;
34 }
35 })
36 0 };
37
38 0 ▶ if(my $error = $@)
Branch: 1 branch
BranchTrueFalseTotal
if (my $error = $@) { } 0 0 0
39 {
40 0 say STDERR "ERROR: in syntax: $error";
41 0 exit 2;
42 }
43 else
44 {
45 0 print Dump({ %$config });
46 }
47 };
48  
49 1 1;
50  
51 __END__
« blib/lib/Clustericious/Command/daemon.pm ↑ Summary blib/lib/Test/Clustericious/Config.pm »