| 1 | package Spoon::Template::Mason; | ||||||||||||
| 2 | |||||||||||||
| 3 | 2 | ▶ | use strict; | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 4 | 2 | ▶ | use warnings; | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 5 | 2 | ▶ | use Spoon 0.23; | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 6 | 2 | ▶ | use Spoon::Template '-base'; | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 7 | |||||||||||||
| 8 | 2 | ▶ | use Cwd (); | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 9 | 2 | ▶ | use HTML::Mason::Interp; | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 10 | |||||||||||||
| 11 | 2 | ▶ | use vars qw ($VERSION); | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 12 | |||||||||||||
| 13 | 2 | $VERSION = 0.05; | |||||||||||
| 14 | |||||||||||||
| 15 | 2 | field 'interp' => | |||||||||||
| 16 | -init => '$self->_make_interp'; | ||||||||||||
| 17 | |||||||||||||
| 18 | sub render | ||||||||||||
| 19 | 1 | ▶ | { | ||||||||||
|
Subroutine
render: called CC=2 SCAR=7.0
Pod
undocumented
| |||||||||||||
| 20 | 1 | my $self = shift; | |||||||||||
| 21 | 1 | my $comp = shift; | |||||||||||
| 22 | |||||||||||||
| 23 | 1 | ▶ | $comp = "/$comp" unless $comp =~ m{^/}; | ||||||||||
|
Branch: 1 branch
| |||||||||||||
| 24 | |||||||||||||
| 25 | 1 | my $output = ''; | |||||||||||
| 26 | 1 | $self->interp->out_method(\$output); | |||||||||||
| 27 | 1 | $self->interp->exec( $comp, $self->all, @_ ); | |||||||||||
| 28 | |||||||||||||
| 29 | 1 | return $output; | |||||||||||
| 30 | } | ||||||||||||
| 31 | |||||||||||||
| 32 | #method private make_interp => sub | ||||||||||||
| 33 | sub _make_interp | ||||||||||||
| 34 | 1 | ▶ | { | ||||||||||
|
Subroutine
_make_interp: called CC=3 SCAR=11.1
| |||||||||||||
| 35 | 1 | my $self = shift; | |||||||||||
| 36 | 1 | ▶ | my $params = shift || {}; | ||||||||||
|
Condition50%1/2
shift() || {}
MC/DC0%0/1
shift() || {}
shift()
Truth table50%1/2
A
A= shift()
| |||||||||||||
| 37 | |||||||||||||
| 38 | 1 | my $root_name = 'root001'; | |||||||||||
| 39 | 1 | my $path = $self->path; | |||||||||||
| 40 | 1 | ▶ | my @roots = map { [ $root_name++ => Cwd::abs_path($_) ] } ref $path ? @$path : $path; | ||||||||||
|
Branch: 1 branch
| |||||||||||||
| 41 | |||||||||||||
| 42 | 1 | my $interp = | |||||||||||
| 43 | HTML::Mason::Interp->new | ||||||||||||
| 44 | ( comp_root => \@roots, | ||||||||||||
| 45 | %$params, | ||||||||||||
| 46 | ); | ||||||||||||
| 47 | |||||||||||||
| 48 | 1 | $self->interp($interp); | |||||||||||
| 49 | }; | ||||||||||||
| 50 | |||||||||||||
| 51 | |||||||||||||
| 52 | 2 | 1; | |||||||||||
| 53 | |||||||||||||
| 54 | __END__ | ||||||||||||