lib/Serge/Command/show.pm

filter: Statementstmt 59.0% 13 / 22 Branchbran 0.0% 0 / 2 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 66.6% 4 / 6 Podpod 0.0% 0 / 2 totaltotal 53.1% 17 / 32 SCAR 8.7
CC
2
Cov
54%
run
6.0
get_commands
2.0
BEGIN
1.0
CRAP 2.4
« lib/Serge/Engine/Plugin/parse_wxl.pm ↑ Summary lib/Serge/Engine/Plugin/parse_bypass.pm »
1 package Serge::Command::show;
2 1 ▶use parent Serge::Command;
Subroutine BEGIN: called CC=1 SCAR=0.0
3  
4 1 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
5  
6 1 ▶use Config::Neat::Inheritable;
Subroutine BEGIN: called CC=1 SCAR=0.0
7 1 ▶use Config::Neat::Render;
Subroutine BEGIN: called CC=1 SCAR=0.0
8  
9 sub get_commands {
10 return {
11 0 ▶ show => {
Subroutine get_commands: not called CC=1 SCAR=6.9
Pod undocumented
12 handler => \&run,
13 info => 'Show expanded version of a configuration file',
14 need_config => 1,
15 },
16 }
17 }
18  
19 sub run {
20 0 ▶ my ($self) = @_;
Subroutine run: not called CC=2 SCAR=17.9
Pod undocumented
21  
22 0 my @config_files = $self->{parent}->get_config_files;
23 0 ▶ die "Multiple configuration files not allowed\n" unless $#config_files == 0;
Branch: 1 branch
BranchTrueFalseTotal
unless $#config_files == 0 0 0 0
24  
25 0 my $cfg = Config::Neat::Inheritable->new();
26 0 my $data = $cfg->parse_file($config_files[0]);
27  
28 0 my $renderer = Config::Neat::Render->new();
29 0 print $renderer->render($data);
30  
31 0 return 0;
32 }
33  
34 1 1;
« lib/Serge/Engine/Plugin/parse_wxl.pm ↑ Summary lib/Serge/Engine/Plugin/parse_bypass.pm »