| 1 | package Dancer::Template::Haml; | ||||||||||||||||||||||||||||
| 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 | |||||||||||||||||||||||||||||
| 6 | 1 | ▶ | use Text::Haml; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 7 | |||||||||||||||||||||||||||||
| 8 | 1 | ▶ | use vars '$VERSION'; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 9 | 1 | ▶ | use base 'Dancer::Template::Abstract'; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 10 | |||||||||||||||||||||||||||||
| 11 | 1 | our $VERSION = '0.01'; | |||||||||||||||||||||||||||
| 12 | |||||||||||||||||||||||||||||
| 13 | 1 | my $_engine; | |||||||||||||||||||||||||||
| 14 | |||||||||||||||||||||||||||||
| 15 | 0 | ▶ | sub init { $_engine = Text::Haml->new } | ||||||||||||||||||||||||||
|
Subroutine
init: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||||||||||||||||||
| 16 | |||||||||||||||||||||||||||||
| 17 | 0 | ▶ | sub render($$$) { | ||||||||||||||||||||||||||
|
Subroutine
render: not called CC=4 SCAR=30.0
Pod
documented
| |||||||||||||||||||||||||||||
| 18 | 0 | my ($self, $template, $tokens) = @_; | |||||||||||||||||||||||||||
| 19 | |||||||||||||||||||||||||||||
| 20 | 0 | $template =~ s/\.tt$/\.haml/; | |||||||||||||||||||||||||||
| 21 | |||||||||||||||||||||||||||||
| 22 | 0 | ▶ | die "'$template' is not a regular file" | ||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
ref $template or not -f $template
MC/DC0%0/2
ref $template or not -f $template
ref $template
not -f $template
Truth table0%0/3
A or not(B)
A= ref $templateB= not -f $template
| |||||||||||||||||||||||||||||
| 23 | if ref($template) || (!-f $template); | ||||||||||||||||||||||||||||
| 24 | |||||||||||||||||||||||||||||
| 25 | 0 | my $content = q{}; | |||||||||||||||||||||||||||
| 26 | 0 | ▶ | $content = $_engine->render_file($template, %$tokens) | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 27 | or die $_engine->error; | ||||||||||||||||||||||||||||
| 28 | 0 | return $content; | |||||||||||||||||||||||||||
| 29 | } | ||||||||||||||||||||||||||||
| 30 | |||||||||||||||||||||||||||||
| 31 | 1 | 1; | |||||||||||||||||||||||||||
| 32 | __END__ | ||||||||||||||||||||||||||||