| 1 | package Email::MIME::MobileJP::Template; | ||||||||||||||||||||||||||||
| 2 | 1 | ▶ | use strict; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 3 | 1 | ▶ | use warnings; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 4 | 1 | ▶ | use utf8; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 5 | |||||||||||||||||||||||||||||
| 6 | 1 | ▶ | use Tiffany; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 7 | 1 | ▶ | use Email::MIME::MobileJP::Creator; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 8 | |||||||||||||||||||||||||||||
| 9 | sub new { | ||||||||||||||||||||||||||||
| 10 | 0 | ▶ | my ( $class, $name, $args ) = @_; | ||||||||||||||||||||||||||
|
Subroutine
new: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||||||||||||||||||||
| 11 | 0 | my $tiffany = Tiffany->load( $name, $args ); | |||||||||||||||||||||||||||
| 12 | 0 | return bless { tiffany => $tiffany }, $class; | |||||||||||||||||||||||||||
| 13 | } | ||||||||||||||||||||||||||||
| 14 | |||||||||||||||||||||||||||||
| 15 | sub render { | ||||||||||||||||||||||||||||
| 16 | 0 | ▶ | my ( $self, $to, $tmpl, @args ) = @_; | ||||||||||||||||||||||||||
|
Subroutine
render: not called CC=6 SCAR=37.4
Pod
undocumented
| |||||||||||||||||||||||||||||
| 17 | 0 | ▶ | Carp::croak('Usage: $tmpl->render($to, $tmpl[, @args])') unless defined $tmpl; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 18 | |||||||||||||||||||||||||||||
| 19 | 0 | my $creator = Email::MIME::MobileJP::Creator->new($to); | |||||||||||||||||||||||||||
| 20 | |||||||||||||||||||||||||||||
| 21 | 0 | my @lines = split /\n/, $self->{tiffany}->render( $tmpl, @args ); | |||||||||||||||||||||||||||
| 22 | 0 | ▶ | while ( @lines > 0 && $lines[0] =~ /^([A-Z][A-Za-z_-]+)\s*:\s*(.+?)$/ ) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
@lines > 0 and $lines[0] =~ /^([A-Z][A-Za-z_-]+)\s*:\s*(.+?)$/
MC/DC0%0/2
@lines > 0 and $lines[0] =~ /^([A-Z][A-Za-z_-]+)\s*:\s*(.+?)$/
@lines > 0
$lines[0] =~ /^([A-Z][A-Za-z_-]+)\s*:\s*(.+?)$/
Truth table0%0/3
A and B
A= @lines > 0B= $lines[0] =~ /^([A-Z][A-Za-z_-]+)\s*:\s*(.+?)$/
| |||||||||||||||||||||||||||||
| 23 | 0 | my ( $key, $val ) = ( $1, $2 ); | |||||||||||||||||||||||||||
| 24 | 0 | $creator->header($key, $val); | |||||||||||||||||||||||||||
| 25 | 0 | shift @lines; | |||||||||||||||||||||||||||
| 26 | } | ||||||||||||||||||||||||||||
| 27 | 0 | ▶ | if ( @lines > 0 && $lines[0] =~ /^\s*$/ ) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
@lines > 0 and $lines[0] =~ /^\s*$/
MC/DC0%0/2
@lines > 0 and $lines[0] =~ /^\s*$/
@lines > 0
$lines[0] =~ /^\s*$/
Truth table0%0/3
A and B
A= @lines > 0B= $lines[0] =~ /^\s*$/
| |||||||||||||||||||||||||||||
| 28 | 0 | shift @lines; | |||||||||||||||||||||||||||
| 29 | } | ||||||||||||||||||||||||||||
| 30 | 0 | $creator->body( join( "\n", @lines) ); | |||||||||||||||||||||||||||
| 31 | |||||||||||||||||||||||||||||
| 32 | 0 | return $creator->finalize(); | |||||||||||||||||||||||||||
| 33 | } | ||||||||||||||||||||||||||||
| 34 | |||||||||||||||||||||||||||||
| 35 | 1 | 1; | |||||||||||||||||||||||||||
| 36 | __END__ | ||||||||||||||||||||||||||||