line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Module::Setup::Plugin::Template; |
2
|
19
|
|
|
19
|
|
79
|
use strict; |
|
19
|
|
|
|
|
27
|
|
|
19
|
|
|
|
|
500
|
|
3
|
19
|
|
|
19
|
|
69
|
use warnings; |
|
19
|
|
|
|
|
24
|
|
|
19
|
|
|
|
|
469
|
|
4
|
19
|
|
|
19
|
|
73
|
use base 'Module::Setup::Plugin'; |
|
19
|
|
|
|
|
25
|
|
|
19
|
|
|
|
|
1230
|
|
5
|
|
|
|
|
|
|
|
6
|
19
|
|
|
19
|
|
9154
|
use Template; |
|
19
|
|
|
|
|
257489
|
|
|
19
|
|
|
|
|
2568
|
|
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
my $TEMPLATE; |
9
|
|
|
|
|
|
|
sub register { |
10
|
76
|
|
|
76
|
0
|
147
|
my($self, ) = @_; |
11
|
76
|
|
|
|
|
124
|
$TEMPLATE = Template->new(%{ $self->{config} }); |
|
76
|
|
|
|
|
691
|
|
12
|
76
|
|
|
|
|
386185
|
$self->add_trigger( template_process => \&template_process ); |
13
|
|
|
|
|
|
|
} |
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
sub template_process { |
16
|
432
|
|
|
432
|
1
|
12233
|
my($self, $opts) = @_; |
17
|
432
|
100
|
|
|
|
1018
|
return unless $opts->{template}; |
18
|
430
|
|
|
|
|
707
|
my $template = delete $opts->{template};; |
19
|
430
|
|
|
|
|
1638
|
$TEMPLATE->process(\$template, $opts->{vars}, \my $content); |
20
|
430
|
|
|
|
|
970747
|
$opts->{content} = $content; |
21
|
|
|
|
|
|
|
} |
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
1; |