blib/lib/Template/Nes/Inject.pm

filter: Statementstmt 86.6% 13 / 15 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 5 / 5 Podpod n/a totaltotal 90.0% 18 / 20 CC 1 SCAR 0.6
CC
1
Cov
87%
BEGIN
1.3
BEGIN
1.0
BEGIN
1.0
CRAP 1.1
↑ Summary
1 # -----------------------------------------------------------------------------
2 #
3 # Template::Nes::Inject by Skriptke
4 # Copyright 2009 - 2010 Enrique F. Castañón Barbero
5 #
6 # Include Nes templates in Template Toolkit.
7 # Requires Nes 1.04 or higher
8 #
9 # -----------------------------------------------------------------------------
10  
11 package Template::Nes::Inject;
12
13 1 ▶ use vars qw(@ISA);
Subroutine BEGIN: called CC=1 SCAR=0.0
14 @ISA = qw( Nes::Template::Top );
15  
16 our $VERSION = '0.00_1';
17  
18 1 ▶ use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
19 1 ▶ use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
20 1 ▶ use Template;
Subroutine BEGIN: called CC=1 SCAR=0.0
21 0 ▶ use Nes::Template;
Subroutine BEGIN: called CC=1 SCAR=2.6
22
23 sub new {
24 my $class = shift;
25 my $self = $class->SUPER::new( shift );
26  
27 $self->{'tt'} = Template->new();
28  
29 return $self;
30 }
31
32 sub process {
33 my $self = shift;
34 my $vars = shift;
35  
36 my $out = '';
37 $self->{'tt'}->process($self->get_out_ref, $vars, \$out )
38 || die "Template process failed: ", $self->{'tt'}->error(), "\n";
39
40 $self->run($vars,$out);
41 }
42  
43
44 1;
45 __END__
↑ Summary