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.3521';
5 194     194   69562 use strict;
  194         380  
  194         5716  
6 194     194   965 use warnings;
  194         388  
  194         4600  
7 194     194   71490 use Dancer::ModuleLoader;
  194         460  
  194         5734  
8 194     194   83157 use Dancer::Engine;
  194         523  
  194         17545  
9              
10             # singleton for the current template engine
11             my $_engine;
12 78     78 1 323 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 2311 my ($class, $name, $config) = @_;
18 210   100     890 $name ||= 'simple';
19 210         1722 $_engine = Dancer::Engine->build(template => $name, $config);
20             }
21              
22             1;
23              
24             __END__