File Coverage

blib/lib/Ukigumo/Agent/View.pm
Criterion Covered Total %
statement 21 23 91.3
branch n/a
condition n/a
subroutine 7 9 77.7
pod 0 1 0.0
total 28 33 84.8


line stmt bran cond sub pod time code
1             package Ukigumo::Agent::View;
2 11     11   57 use strict;
  11         25  
  11         376  
3 11     11   55 use warnings;
  11         20  
  11         278  
4 11     11   56 use utf8;
  11         20  
  11         77  
5 11     11   11339 use Text::Xslate;
  11         123147  
  11         648  
6 11     11   362 use List::Util qw(first);
  11         23  
  11         1065  
7 11     11   55 use File::Spec;
  11         12  
  11         1839  
8              
9             sub make_instance {
10 11     11 0 34 my ($class, $c) = @_;
11              
12 11         62 my $path = File::Spec->catdir($c->share_dir, 'tmpl');
13             my $xslate = Text::Xslate->new(
14             syntax => 'TTerse',
15             path => ["$path"],
16             module => [
17             'Text::Xslate::Bridge::Star',
18             'Time::Piece' => ['localtime'],
19             'Time::Duration' => ['duration'],
20             ],
21             function => {
22 0     0     time => sub { time() },
23 0     0     uri_for => sub { Amon2->context()->uri_for(@_) },
24             },
25 11         1849 );
26             }
27              
28             1;
29