| 1 | package Module::Setup::Plugin::Template; | ||||||||||
| 2 | 19 | ▶ | use strict; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 3 | 19 | ▶ | use warnings; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 4 | 19 | ▶ | use base 'Module::Setup::Plugin'; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 5 | |||||||||||
| 6 | 19 | ▶ | use Template; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 7 | |||||||||||
| 8 | 19 | my $TEMPLATE; | |||||||||
| 9 | sub register { | ||||||||||
| 10 | 76 | ▶ | my($self, ) = @_; | ||||||||
|
Subroutine
register: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||
| 11 | 76 | $TEMPLATE = Template->new(%{ $self->{config} }); | |||||||||
| 12 | 76 | $self->add_trigger( template_process => \&template_process ); | |||||||||
| 13 | } | ||||||||||
| 14 | |||||||||||
| 15 | sub template_process { | ||||||||||
| 16 | 432 | ▶ | my($self, $opts) = @_; | ||||||||
|
Subroutine
template_process: called CC=2 SCAR=6.9
Pod
documented
| |||||||||||
| 17 | 432 | ▶ | return unless $opts->{template}; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 18 | 430 | my $template = delete $opts->{template};; | |||||||||
| 19 | 430 | $TEMPLATE->process(\$template, $opts->{vars}, \my $content); | |||||||||
| 20 | 430 | $opts->{content} = $content; | |||||||||
| 21 | } | ||||||||||
| 22 | |||||||||||
| 23 | 19 | 1; | |||||||||