« 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
| |||||||||||
| 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; | |||||||||