File Coverage

blib/lib/App/Embra/Plugin/Template/Basic.pm
Criterion Covered Total %
statement 22 22 100.0
branch 1 2 50.0
condition n/a
subroutine 8 8 100.0
pod n/a
total 31 32 96.8


line stmt bran cond sub pod time code
1 1     1   2007 use strict;
  1         2  
  1         33  
2 1     1   6 use warnings;
  1         1  
  1         58  
3              
4             package App::Embra::Plugin::Template::Basic;
5             $App::Embra::Plugin::Template::Basic::VERSION = '0.001'; # TRIAL
6             # ABSTRACT: simple HTML5 template
7              
8 1     1   855 use Method::Signatures;
  1         64428  
  1         5  
9 1     1   777 use App::Embra::Plugin::TemplateToolkit;
  1         3  
  1         32  
10 1     1   547 use File::ShareDir;
  1         5596  
  1         74  
11 1     1   6 use Moo;
  1         2  
  1         7  
12              
13              
14              
15             has 'assembler' => (
16             is => 'lazy',
17             handles => [ 'assemble_files' ],
18             );
19              
20 1 50   1   929 method _build_assembler {
  1     1   808  
  1         8  
21 1         9 App::Embra::Plugin::TemplateToolkit->new(
22             embra => $self->embra,
23             logger => $self,
24             name => 'TemplateToolkit',
25             include_path => File::ShareDir::module_dir(__PACKAGE__),
26             );
27             }
28              
29             with 'App::Embra::Role::FileAssembler';
30              
31             1;
32              
33             __END__
34              
35             =pod
36              
37             =encoding UTF-8
38              
39             =head1 NAME
40              
41             App::Embra::Plugin::Template::Basic - simple HTML5 template
42              
43             =head1 VERSION
44              
45             version 0.001
46              
47             =head1 DESCRIPTION
48              
49             This plugin will process site files through Template Toolkit with a pre-defined set of templates. For each file with a C<.html> extension, it will look for a template with a matching name and use it to process the contents of the file into an assembled HTML document.
50              
51             The templates are stored as a L<File::ShareDir>, which in the source of the distribution are located at C<share/Plugin/Template/Basic>.
52              
53             =head1 ATTRIBUTES
54              
55             =head2 assembler
56              
57             The object used to assemble files. Defaults to an instance of L<App::Embra::Plugin::TemplateToolkit>.
58              
59             =head1 AUTHOR
60              
61             Daniel Holz <dgholz@gmail.com>
62              
63             =head1 COPYRIGHT AND LICENSE
64              
65             This software is copyright (c) 2015 by Daniel Holz.
66              
67             This is free software; you can redistribute it and/or modify it under
68             the same terms as the Perl 5 programming language system itself.
69              
70             =cut