blib/lib/Text/MicroMason/StoreOne.pm

filter: Statementstmt 100% 15 / 15 Branchbran 87.5% 7 / 8 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 3 / 3 Podpod 100% 3 / 3 totaltotal 96.5% 28 / 29 CC 5 SCAR 11.0
CC
5
Cov
96%
create
4.0
execute_again
2.0
compile
1.0
CRAP 3.0
« blib/lib/Text/MicroMason/AllowGlobals.pm ↑ Summary blib/lib/Text/MicroMason/PLP.pm »
1 package Text::MicroMason::StoreOne;
2  
3 ######################################################################
4  
5 14 ▶sub create {
Subroutine create: called CC=4 SCAR=13.9
Pod documented
6 14 my ( $class, %options ) = @_;
7 14 my @compile;
8 14 ▶ if ( my $file = delete $options{filename} ) {
Branch: 2 branches
BranchTrueFalseTotal
if (my $file = delete $options{'filename'}) { } 5 9 14
elsif (my $string = delete $options{'text'}) { } 2 7 9
9 5 @compile = ( 'file' => $file );
10 } elsif ( my $string = delete $options{text} ) {
11 2 @compile = ( 'text' => $string );
12 }
13 14 my $self = $class->NEXT('create', %options);
14 14 ▶ $self->compile( @compile ) if @compile;
Branch: 1 branch
BranchTrueFalseTotal
if @compile 7 7 14
15 14 $self;
16 }
17  
18 9 ▶sub compile {
Subroutine compile: called CC=1 SCAR=0.0
Pod documented
19 9 my $self = shift;
20 9 my $sub = $self->NEXT('compile', @_);
21 9 $self->{last_compile} = $sub;
22 }
23  
24 12 ▶sub execute_again {
Subroutine execute_again: called CC=2 SCAR=7.1
Pod documented
25 12 my $self = shift;
26 my $sub = $self->{last_compile}
27 12 ▶ or $self->croak_msg("No template has been compiled yet");
Branch: 1 branch
BranchTrueFalseTotal
my $sub = $self->{"last_compile"} or $self->croak_msg("No template has been compiled yet") 12 0 12
28 12 &$sub( @_ );
29 }
30  
31 ######################################################################
32  
33 2 1;
34  
35 __END__
« blib/lib/Text/MicroMason/AllowGlobals.pm ↑ Summary blib/lib/Text/MicroMason/PLP.pm »