line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Module::Setup::Plugin::Template; |
2
|
25
|
|
|
25
|
|
13219
|
use strict; |
|
25
|
|
|
|
|
65
|
|
|
25
|
|
|
|
|
911
|
|
3
|
25
|
|
|
25
|
|
152
|
use warnings; |
|
25
|
|
|
|
|
53
|
|
|
25
|
|
|
|
|
934
|
|
4
|
25
|
|
|
25
|
|
135
|
use base 'Module::Setup::Plugin'; |
|
25
|
|
|
|
|
60
|
|
|
25
|
|
|
|
|
4047
|
|
5
|
|
|
|
|
|
|
|
6
|
25
|
|
|
25
|
|
32184
|
use Template; |
|
25
|
|
|
|
|
634415
|
|
|
25
|
|
|
|
|
4475
|
|
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
my $TEMPLATE; |
9
|
|
|
|
|
|
|
sub register { |
10
|
88
|
|
|
88
|
0
|
235
|
my($self, ) = @_; |
11
|
88
|
|
|
|
|
210
|
$TEMPLATE = Template->new(%{ $self->{config} }); |
|
88
|
|
|
|
|
1098
|
|
12
|
88
|
|
|
|
|
922767
|
$self->add_trigger( template_process => \&template_process ); |
13
|
|
|
|
|
|
|
} |
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
sub template_process { |
16
|
469
|
|
|
469
|
1
|
24259
|
my($self, $opts) = @_; |
17
|
469
|
100
|
|
|
|
1587
|
return unless $opts->{template}; |
18
|
467
|
|
|
|
|
1233
|
my $template = delete $opts->{template};; |
19
|
467
|
|
|
|
|
3120
|
$TEMPLATE->process(\$template, $opts->{vars}, \my $content); |
20
|
467
|
|
|
|
|
1926541
|
$opts->{content} = $content; |
21
|
|
|
|
|
|
|
} |
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
1; |