File Coverage

blib/lib/Dancer/Template.pm
Criterion Covered Total %
statement 16 16 100.0
branch n/a
condition 2 2 100.0
subroutine 6 6 100.0
pod 1 2 50.0
total 25 26 96.1


line stmt bran cond sub pod time code
1             package Dancer::Template;
2             our $AUTHORITY = 'cpan:SUKRIA';
3             #ABSTRACT: template wrapper for Dancer
4             $Dancer::Template::VERSION = '1.3520';
5 194     194   73102 use strict;
  194         462  
  194         5726  
6 194     194   993 use warnings;
  194         448  
  194         4752  
7 194     194   71507 use Dancer::ModuleLoader;
  194         498  
  194         5956  
8 194     194   78123 use Dancer::Engine;
  194         571  
  194         17821  
9              
10             # singleton for the current template engine
11             my $_engine;
12 78     78 1 317 sub engine { $_engine }
13              
14             # init the engine according to the settings the template engine module will
15             # take from the setting name.
16             sub init {
17 210     210 0 2294 my ($class, $name, $config) = @_;
18 210   100     932 $name ||= 'simple';
19 210         1822 $_engine = Dancer::Engine->build(template => $name, $config);
20             }
21              
22             1;
23              
24             __END__