Haml.pm

filter: Statementstmt 72.0% 18 / 25 Branchbran 0.0% 0 / 4 Conditioncond 0.0% 0 / 3 MC/DCmcdc 0.0% 0 / 2 Subroutinesub 71.4% 5 / 7 Podpod 100% 2 / 2 totaltotal 58.1% 25 / 43 CC 4 SCAR 21.6
CC
4
Cov
56%
render
20.0
init
2.0
BEGIN
1.0
CRAP 8.7
↑ Summary ._Haml.pm »
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
BranchTrueFalseTotal
if ref $template or not -f $template 0 0 0
Condition0%0/3
ref $template or not -f $template
l!l&&r!l&&!r
000
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
ABresult
1X1
011
000
23 if ref($template) || (!-f $template);
24  
25 0 my $content = q{};
26 0 ▶ $content = $_engine->render_file($template, %$tokens)
Branch: 1 branch
BranchTrueFalseTotal
$content = $_engine->render_file($template, %$tokens) or die $_engine->error 0 0 0
27 or die $_engine->error;
28 0 return $content;
29 }
30  
31 1 1;
32 __END__
↑ Summary ._Haml.pm »