File Coverage

blib/lib/Report/Generator/Render/TT2.pm
Criterion Covered Total %
statement 36 37 97.3
branch 7 14 50.0
condition 4 10 40.0
subroutine 8 8 100.0
pod 2 2 100.0
total 57 71 80.2


line stmt bran cond sub pod time code
1             package Report::Generator::Render::TT2;
2              
3 1     1   6 use strict;
  1         3  
  1         37  
4 1     1   5 use warnings;
  1         1  
  1         40  
5 1     1   6 use vars qw(@ISA $VERSION);
  1         2  
  1         56  
6              
7 1     1   1149 use File::ShareDir ();
  1         14317  
  1         35  
8 1     1   15 use File::Spec ();
  1         2  
  1         24  
9 1     1   6 use Params::Util qw(_ARRAY0);
  1         2  
  1         498  
10              
11             require Report::Generator::Render;
12             require Template;
13              
14             =head1 NAME
15              
16             Report::Generator::Render::TT2 - class for rendering reports using TT2
17              
18             =cut
19              
20             $VERSION = '0.002';
21             @ISA = qw(Report::Generator::Render);
22              
23             =head1 SYNOPSIS
24              
25             my %cfg = (
26             renderer => 'Report::Generator::Render::TT2',
27             'Report::Generator::Render::TT2' => {
28             config => { ABSOLUTE => 1, },
29             output => 'test1.ext',
30             vars => { },
31             template => 'test1.tt2',
32             options => {},
33             },
34             );
35             Report::Generator->new({cfg => \%cfg})->generate();
36              
37             =head1 DESCRIPTION
38              
39             C provides a base class for rendering
40             reports in L using Template::Toolkit.
41              
42             See the C examples in the examples directory of this
43             distribution to get a sense who to use this renderer.
44              
45             =head1 SUBROUTINES/METHODS
46              
47             =head2 new
48              
49             Instantiates a new TT2 renderer for C.
50              
51             Report::Generator::Render::TT2->new(
52             {
53             config => { ... },
54             vars => { ... },
55             options => { ... },
56             template => 'path/to/template',
57             output => 'path/to/output',
58             }
59             );
60              
61             The parameters C, and are optional, C