lib/Log/Munger/App/Command/rule_file_template_order.pm

filter: Statementstmt 92.3% 24 / 26 Branchbran 100% 2 / 2 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 80.0% 8 / 10 Podpod 80.0% 4 / 5 totaltotal 88.3% 38 / 43 CC 2 SCAR 3.1
CC
2
Cov
93%
abstract
2.0
description
2.0
execute
2.0
CRAP 1.4
« lib/Log/Munger/App/Command/which_rule_file.pm ↑ Summary lib/Log/Munger/App/Command/test_rule_file.pm »
1 package Log::Munger::App::Command::rule_file_template_order;
2  
3 16 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 16 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 16 ▶use Log::Munger::App -command;
Subroutine BEGIN: called CC=1 SCAR=0.0
6 16 ▶use Log::Munger::RulesTemplateOrder;
Subroutine BEGIN: called CC=1 SCAR=0.0
7 16 ▶use YAML::XS qw(Dump);
Subroutine BEGIN: called CC=1 SCAR=0.0
8  
9 2 ▶sub opt_spec {
Subroutine opt_spec: called CC=1 SCAR=0.0
Pod documented
10 2 return ( [ 'f=s', 'Rule file to read.', { 'default' => 'base' } ], [ 'd', 'Print depend info.' ], );
11 }
12  
13 0 ▶sub abstract { "Show the order a rule file's templated vars get resolved in" }
Subroutine abstract: not called CC=1 SCAR=6.9
Pod documented
14  
15 0 ▶sub description {
Subroutine description: not called CC=1 SCAR=6.9
Pod documented
16 0 "A rule file's vars_templated entries reference each other, so they have to be resolved in
17 dependency order. This prints that order.
18  
19 With -d it prints the dependency map that order was worked out from instead, which is what to
20 look at when a var is not resolving.
21 ";
22 }
23  
24 2 ▶sub validate { return 1 }
Subroutine validate: called CC=1 SCAR=0.0
Pod undocumented
25  
26 2 ▶sub execute {
Subroutine execute: called CC=2 SCAR=6.9
Pod documented
27 2 my ( $self, $opts, $args ) = @_;
28  
29 2 my $results;
30 2 ▶ if ( !$opts->{'d'} ) {
Branch: 1 branch
BranchTrueFalseTotal
if (not $opts->{'d'}) { } 1 1 2
31 1 $results = Log::Munger::RulesTemplateOrder->order_for_rules_file( 'file' => $opts->{'f'} );
32 } else {
33 1 $results = Log::Munger::RulesTemplateOrder->depends_for_rules_file( 'file' => $opts->{'f'} );
34 }
35  
36 2 print Dump($results);
37 } ## end sub execute
38  
39 16 1;
« lib/Log/Munger/App/Command/which_rule_file.pm ↑ Summary lib/Log/Munger/App/Command/test_rule_file.pm »