| 1 | package Mail::Builder::Simple::TT; | ||||||||||||||
| 2 | |||||||||||||||
| 3 | 1 | ▶ | use strict; | ||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||
| 4 | 1 | ▶ | use warnings; | ||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||
| 5 | 1 | ▶ | use Template; | ||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||
| 6 | 1 | ▶ | use Cwd; | ||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||
| 7 | 1 | ▶ | use Exception::Died; | ||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||
| 8 | |||||||||||||||
| 9 | 1 | ▶ | use 5.008_008; | ||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||
| 10 | |||||||||||||||
| 11 | 1 | our $VERSION = '0.03'; | |||||||||||||
| 12 | |||||||||||||||
| 13 | 2 | ▶ | sub new { | ||||||||||||
|
Subroutine
new: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||||
| 14 | 2 | my ( $class, $args, $vars ) = @_; | |||||||||||||
| 15 | |||||||||||||||
| 16 | 2 | my $self = { | |||||||||||||
| 17 | template_args => $args, | ||||||||||||||
| 18 | template_vars => $vars, | ||||||||||||||
| 19 | }; | ||||||||||||||
| 20 | |||||||||||||||
| 21 | 2 | return bless $self, $class; | |||||||||||||
| 22 | } | ||||||||||||||
| 23 | |||||||||||||||
| 24 | 1 | ▶ | sub process { | ||||||||||||
|
Subroutine
process: called CC=7 SCAR=22.4
Pod
documented
| |||||||||||||||
| 25 | 1 | my ( $self, $template, $source ) = @_; | |||||||||||||
| 26 | |||||||||||||||
| 27 | 1 | my $args = $self->{template_args}; | |||||||||||||
| 28 | 1 | ▶ | $args->{INCLUDE_PATH} ||= q{.}; | ||||||||||||
|
Condition50%1/2
$args->{"INCLUDE_PATH"} ||= "."
MC/DC0%0/1
$args->{"INCLUDE_PATH"} ||= "."
$args->{"INCLUDE_PATH"}
Truth table50%1/2
A
A= $args->{"INCLUDE_PATH"}
| |||||||||||||||
| 29 | 1 | ▶ | $args->{ENCODING} ||= 'utf8'; | ||||||||||||
|
Condition50%1/2
$args->{"ENCODING"} ||= "utf8"
MC/DC0%0/1
$args->{"ENCODING"} ||= "utf8"
$args->{"ENCODING"}
Truth table50%1/2
A
A= $args->{"ENCODING"}
| |||||||||||||||
| 30 | |||||||||||||||
| 31 | 1 | my $t = Template->new($args); | |||||||||||||
| 32 | |||||||||||||||
| 33 | 1 | my $output = q{}; | |||||||||||||
| 34 | 1 | ▶ | if ( $source eq 'file' ) { | ||||||||||||
|
Branch: 2 branches
| |||||||||||||||
| 35 | 0 | ▶ | $t->process( $template, $self->{template_vars}, \$output ) | ||||||||||||
|
Branch: 1 branch
| |||||||||||||||
| 36 | || Exception::Died->throw( $t->error ); | ||||||||||||||
| 37 | } | ||||||||||||||
| 38 | elsif ( $source eq 'scalar' ) { | ||||||||||||||
| 39 | 1 | ▶ | $t->process( \$template, $self->{template_vars}, \$output ) | ||||||||||||
|
Branch: 1 branch
| |||||||||||||||
| 40 | || Exception::Died->throw( $t->error ); | ||||||||||||||
| 41 | } | ||||||||||||||
| 42 | |||||||||||||||
| 43 | 1 | return $output; | |||||||||||||
| 44 | } | ||||||||||||||
| 45 | |||||||||||||||
| 46 | 1 | 1; | |||||||||||||
| 47 | |||||||||||||||
| 48 | __END__ | ||||||||||||||