File Coverage

blib/lib/Kelp/Module/Template/XslateTT.pm
Criterion Covered Total %
statement 16 16 100.0
branch n/a
condition n/a
subroutine 5 5 100.0
pod 1 1 100.0
total 22 22 100.0


line stmt bran cond sub pod time code
1             package Kelp::Module::Template::XslateTT;
2              
3             # $Id: XslateTT.pm 66 2018-11-21 18:22:53Z stro $
4              
5 2     2   158995 use strict;
  2         9  
  2         47  
6 2     2   9 use warnings;
  2         14  
  2         44  
7              
8 2     2   373 use Kelp::Base 'Kelp::Module::Template::Xslate';
  2         15827  
  2         13  
9 2     2   34745 use Text::Xslate;
  2         4  
  2         201  
10              
11             our $VERSION = 1.002;
12              
13             attr ext => 'tt';
14              
15             sub build_engine {
16 1     1 1 16394 my ($self, %args) = @_;
17 1         3 $args{'syntax'} = 'TTerse';
18 1         3 $args{'suffix'} = '.tt';
19 1         10 Text::Xslate->new(%args);
20             }
21              
22             =head1 NAME
23              
24             Kelp::Module::Template::XslateTT - process .tt files with Text::Xslate
25              
26             =head1 SYNOPSIS
27              
28             config.yml:
29              
30             modules:
31             Template::XslateTT
32             modules_init:
33             Template::XslateTT:
34             path:
35             - ./views
36             - ../views
37              
38             config.pl:
39              
40             'modules' => [ qw/ Template::XslateTT / ],
41             'modules_init' => {
42             'Template::XslateTT' => {
43             'path' => [
44             './views',
45             '../views',
46             ],
47             },
48             },
49              
50             =head1 DESCRIPTION
51              
52             Kelp::Module::Template::XslateTT is a drop-in replacement for Template-Tiny and Template-Toolkit engines in Kelp.
53             It allows to use faster Xslate template engine without modifying your templates, renaming files, or changing the code.
54             All you need is changing a few lines in your Kelp config file.
55              
56             =head1 VERSION
57              
58             1.002
59              
60             =head1 AUTHOR
61              
62             (c) 2018 Serguei Trouchelle E<lt>stro@cpan.orgE<gt>.
63              
64             =head1 LICENCE
65              
66             This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
67              
68             =head1 SEE ALSO
69              
70             L<Kelp>,
71             L<Text::Xslate>,
72             L<Kelp::Module::Template::Xslate>
73              
74             =cut
75              
76             1;