lib/Reaction/UI/View/TT.pm

filter: Statementstmt 74.1% 23 / 31 Branchbran 0.0% 0 / 2 Conditioncond 50.0% 1 / 2 MC/DCmcdc 0.0% 0 / 1 Subroutinesub 87.5% 7 / 8 Podpod 0.0% 0 / 3 totaltotal 65.9% 31 / 47 CC 4 SCAR 14.3
CC
4
Cov
69%
serve_static_file
12.0
BUILD
2.0
BEGIN
1.0
CRAP 4.2
« lib/Reaction/UI/Widget.pm ↑ Summary lib/Reaction/Class.pm »
1 package Reaction::UI::View::TT;
2  
3 4 ▶use Reaction::Class;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 4 ▶use aliased 'Reaction::UI::View';
Subroutine BEGIN: called CC=1 SCAR=0.0
5 4 ▶use Template;
Subroutine BEGIN: called CC=1 SCAR=0.0
6  
7 4 ▶use namespace::clean -except => [ qw(meta) ];
Subroutine BEGIN: called CC=1 SCAR=0.0
8 4 extends View;
9  
10  
11  
12 4 has '_tt' => (isa => 'Template', is => 'rw', lazy_fail => 1);
13 3 ▶sub BUILD {
Subroutine BUILD: called CC=2 SCAR=7.1
Pod undocumented
14 3 my ($self, $args) = @_;
15 3 ▶ my $tt_args = $args->{tt}||{};
Condition50%1/2
$args->{'tt'} || {}
l!l
03
MC/DC0%0/1
$args->{'tt'} || {}
$args->{'tt'}
Truth table50%1/2
A
A= $args->{'tt'}
Aresult
11
00
16 3 $self->_tt(Template->new($tt_args));
17 };
18 22 ▶override 'layout_set_args_for' => sub {
Subroutine __ANON__: called CC=1 SCAR=0.0
19 22 my ($self) = @_;
20 22 return (super(), tt_object => $self->_tt);
21 4 };
22 35 ▶sub layout_set_file_extension { 'tt' };
Subroutine layout_set_file_extension: called CC=1 SCAR=0.0
Pod undocumented
23 0 ▶sub serve_static_file {
Subroutine serve_static_file: not called CC=3 SCAR=24.8
Pod undocumented
24 0 my ($self, $c, $args) = @_;
25 0 foreach my $path (@{$self->search_path_for_type('web')}) {
26 0 my $cand = $path->file(@$args);
27 0 ▶ if ($cand->stat) {
Branch: 1 branch
BranchTrueFalseTotal
if ($cand->stat) 0 0 0
28 0 $c->serve_static_file($cand);
29 0 return 1;
30 }
31 }
32 0 return 0;
33 };
34  
35 4 __PACKAGE__->meta->make_immutable;
36  
37  
38 4 1;
« lib/Reaction/UI/Widget.pm ↑ Summary lib/Reaction/Class.pm »