blib/lib/BalanceOfPower/Printer.pm untested

filter: Statementstmt 0.0% 0 / 24 Branchbran 0.0% 0 / 2 Conditioncond 0.0% 0 / 2 MC/DCmcdc n/a Subroutinesub 0.0% 0 / 3 Podpod 0.0% 0 / 1 totaltotal 0.0% 0 / 32 CC 2 SCAR 13.9
CC
2
Cov
0%
print
6.0
BEGIN
2.0
BEGIN
2.0
CRAP 4.0
1 package BalanceOfPower::Printer;
2 $BalanceOfPower::Printer::VERSION = '0.300010';
3 use Template;
4 use Cwd 'abs_path';
5  
6 sub print
7 {
8 my $mode = shift;
9 my $world = shift;
10 my $template = shift;
11 my $vars = shift;
12  
13 my $module_file_path = __FILE__;
14 my $root_path = abs_path($module_file_path);
15 $root_path =~ s/Printer\.pm//;
16 $root_path .= "templates";
17  
18 my $tt = Template->new({INCLUDE_PATH => "$root_path/$mode",
19 PLUGIN_BASE => 'Template::Plugin::Filter'});
20  
21 if(ref $world eq 'BalanceOfPower::World')
22 {
23 my %nation_codes = reverse %{$world->nation_codes};
24 $vars->{'nation_codes'} = \%nation_codes;
25 }
26 my $output;
27 $tt->process("$template.tt", $vars, \$output) || die $tt->error . "\n";
28 return $output;
29 }
30  
31 1;
32