line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Moxy::Plugin; |
2
|
12
|
|
|
12
|
|
3802
|
use strict; |
|
12
|
|
|
|
|
27
|
|
|
12
|
|
|
|
|
372
|
|
3
|
12
|
|
|
12
|
|
61
|
use warnings; |
|
12
|
|
|
|
|
24
|
|
|
12
|
|
|
|
|
317
|
|
4
|
12
|
|
|
12
|
|
62
|
use base qw/Class::Component::Plugin/; |
|
12
|
|
|
|
|
19
|
|
|
12
|
|
|
|
|
2389
|
|
5
|
12
|
|
|
12
|
|
47687
|
use YAML; |
|
12
|
|
|
|
|
20495
|
|
|
12
|
|
|
|
|
915
|
|
6
|
12
|
|
|
12
|
|
1807
|
use Path::Class; |
|
12
|
|
|
|
|
116016
|
|
|
12
|
|
|
|
|
758
|
|
7
|
12
|
|
|
12
|
|
79
|
use Carp; |
|
12
|
|
|
|
|
22
|
|
|
12
|
|
|
|
|
1098
|
|
8
|
12
|
|
|
12
|
|
12275
|
use Template; |
|
12
|
|
|
|
|
317681
|
|
|
12
|
|
|
|
|
131
|
|
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
sub assets_path { |
11
|
0
|
|
|
0
|
0
|
|
my ($proto, $context) = @_; |
12
|
0
|
0
|
|
|
|
|
croak "argument \$context missing" unless ref $context; |
13
|
|
|
|
|
|
|
|
14
|
0
|
|
0
|
|
|
|
my $module = ref $proto || $proto; |
15
|
0
|
|
|
|
|
|
$module =~ s/^Moxy::Plugin:://; |
16
|
0
|
|
|
|
|
|
$module =~ s/::/-/g; |
17
|
|
|
|
|
|
|
|
18
|
0
|
|
|
|
|
|
dir($context->assets_path, 'plugins', $module); |
19
|
|
|
|
|
|
|
} |
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
sub render_template { |
22
|
0
|
|
|
0
|
0
|
|
my ($self, $context, $fname, $args) = @_; |
23
|
|
|
|
|
|
|
|
24
|
0
|
|
|
|
|
|
my $tt = Template->new( |
25
|
|
|
|
|
|
|
ABSOLUTE => 1, |
26
|
|
|
|
|
|
|
ENCODING => 'utf8', |
27
|
|
|
|
|
|
|
); |
28
|
0
|
0
|
|
|
|
|
$tt->process( |
29
|
|
|
|
|
|
|
$self->assets_path($context)->file($fname)->stringify, |
30
|
|
|
|
|
|
|
$args, |
31
|
|
|
|
|
|
|
\my $output |
32
|
|
|
|
|
|
|
) or die $tt->error; |
33
|
0
|
|
|
|
|
|
return $output; |
34
|
|
|
|
|
|
|
} |
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
1; |
37
|
|
|
|
|
|
|
__END__ |