line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Text::MicroMason::StoreOne; |
2
|
|
|
|
|
|
|
|
3
|
|
|
|
|
|
|
###################################################################### |
4
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
sub create { |
6
|
14
|
|
|
14
|
1
|
99
|
my ( $class, %options ) = @_; |
7
|
14
|
|
|
|
|
11
|
my @compile; |
8
|
14
|
100
|
|
|
|
34
|
if ( my $file = delete $options{filename} ) { |
|
|
100
|
|
|
|
|
|
9
|
5
|
|
|
|
|
5
|
@compile = ( 'file' => $file ); |
10
|
|
|
|
|
|
|
} elsif ( my $string = delete $options{text} ) { |
11
|
2
|
|
|
|
|
3
|
@compile = ( 'text' => $string ); |
12
|
|
|
|
|
|
|
} |
13
|
14
|
|
|
|
|
53
|
my $self = $class->NEXT('create', %options); |
14
|
14
|
100
|
|
|
|
41
|
$self->compile( @compile ) if @compile; |
15
|
14
|
|
|
|
|
54
|
$self; |
16
|
|
|
|
|
|
|
} |
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
sub compile { |
19
|
9
|
|
|
9
|
1
|
454
|
my $self = shift; |
20
|
9
|
|
|
|
|
26
|
my $sub = $self->NEXT('compile', @_); |
21
|
9
|
|
|
|
|
85
|
$self->{last_compile} = $sub; |
22
|
|
|
|
|
|
|
} |
23
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
sub execute_again { |
25
|
12
|
|
|
12
|
1
|
12
|
my $self = shift; |
26
|
|
|
|
|
|
|
my $sub = $self->{last_compile} |
27
|
12
|
50
|
|
|
|
25
|
or $self->croak_msg("No template has been compiled yet"); |
28
|
12
|
|
|
|
|
22
|
&$sub( @_ ); |
29
|
|
|
|
|
|
|
} |
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
###################################################################### |
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
1; |
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
__END__ |