| 1 | package Dancer2::Template::TextTemplate::FakeEngine; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 2 | # ABSTRACT: Fake Template::Toolkit-like, persistent engine around Text::Template. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 3 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 4 | 5 | ▶ | use strict; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 5 | 5 | ▶ | use warnings; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 6 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 7 | 5 | our $VERSION = '1.003'; # VERSION | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 8 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 9 | 5 | ▶ | use Moo; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 10 | 5 | ▶ | use MooX::Types::MooseLike::Base qw( InstanceOf Bool ArrayRef Int Str ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 11 | 5 | ▶ | use Carp 'croak'; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 12 | 5 | ▶ | use Text::Template 1.46; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 13 | 5 | ▶ | use CHI; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 14 | 5 | ▶ | use Safe 2.26; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 15 | 5 | ▶ | use Scalar::Util 'blessed'; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 16 | 5 | ▶ | use namespace::clean; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 17 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 18 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 19 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 20 | 5 | has _cache => ( | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 21 | is => 'rwp', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 22 | isa => InstanceOf['CHI::Driver'], | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 23 | lazy => 1, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 24 | builder => '_build_cache', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 25 | ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 26 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 27 | 2 | ▶ | sub _build_cache { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_build_cache: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 28 | 2 | my $self = shift; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 29 | 2 | return CHI->new( | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 30 | driver => 'Memory', # THIS should be generalized | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 31 | expires_on_backend => 1, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 32 | global => 1, # CHI::Driver::Memory-specific | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 33 | ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 34 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 35 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 36 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 37 | 5 | has caching => ( | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 38 | is => 'rw', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 39 | isa => Bool, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 40 | default => 1, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 41 | ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 42 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 43 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 44 | 5 | has expires => ( | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 45 | is => 'rw', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 46 | isa => Int, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 47 | default => 3600, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 48 | ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 49 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 50 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 51 | has delimiters => ( | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 52 | is => 'rw', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 53 | isa => ArrayRef[Str], | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 54 | 4 | ▶ | default => sub { [ '{', '}' ] }, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
__ANON__: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 55 | 5 | ); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 56 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 57 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 58 | 5 | has cache_stringrefs => ( | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 59 | is => 'rw', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 60 | isa => Bool, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 61 | default => 1, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 62 | ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 63 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 64 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 65 | 5 | has prepend => ( | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 66 | is => 'rw', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 67 | isa => Str, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 68 | default => <<'END', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 69 | use strict; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 70 | use warnings FATAL => 'all'; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 71 | END | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 72 | ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 73 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 74 | # Text::Template's HASH variables (as exclusively used by FakeEngine) are not | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 75 | # installed in the template evaluation package in a "use strict"-compatible | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 76 | # way, but we enforce "use strict" in PREPEND, so we need to declare ourselves | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 77 | # these variables just after the PREPENDed code. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 78 | 21 | ▶ | sub _declare_arg_variables { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_declare_arg_variables: called CC=5 SCAR=16.3
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 79 | 21 | my $hash = shift; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 80 | 21 | my @decls; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 81 | 21 | ▶ | while ( my ( $name, $value ) = each %$hash ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 82 | 7 | ▶ | next unless defined $value; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 83 | 7 | push @decls, do { | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 84 | 0 | ▶ | if ( ref $value eq 'ARRAY' ) { '@' } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 2 branches
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 85 | 6 | elsif ( ref $value eq 'HASH' ) { '%' } | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 86 | 1 | else { '$' } | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 87 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 88 | . $name; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 89 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 90 | 21 | return join "\n" => map { "our $_;" } @decls; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 91 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 92 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 93 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 94 | 5 | has safe => ( | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 95 | is => 'rw', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 96 | isa => Bool, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 97 | default => 1, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 98 | ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 99 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 100 | has safe_opcodes => ( | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 101 | is => 'rw', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 102 | isa => ArrayRef[Str], | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 103 | 4 | ▶ | default => sub { [qw[ :default require caller dofile ]] }, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
__ANON__: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 104 | 0 | ▶ | trigger => sub { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
__ANON__: not called CC=1 SCAR=6.9
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 105 | 0 | my $self = shift; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 106 | 0 | $self->_safe->permit_only(@{ $_[0] }); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 107 | }, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 108 | 5 | ); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 109 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 110 | has safe_disposable => ( | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 111 | is => 'rw', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 112 | isa => Bool, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 113 | default => 0, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 114 | 3 | ▶ | trigger => sub { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
__ANON__: called CC=2 SCAR=6.9
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 115 | 3 | my $self = shift; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 116 | 3 | ▶ | $self->_rebuild_safe if $_[0]; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 117 | }, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 118 | 5 | ); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 119 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 120 | 5 | has _safe => ( | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 121 | is => 'rw', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 122 | isa => InstanceOf['Safe'], | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 123 | lazy => 1, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 124 | builder => '_build_safe', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 125 | ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 126 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 127 | 12 | ▶ | sub _build_safe { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_build_safe: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 128 | 12 | my $self = shift; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 129 | 12 | my $safe = Safe->new; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 130 | 12 | $safe->permit_only(@{ $self->safe_opcodes }); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 131 | 12 | return $safe; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 132 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 133 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 134 | 9 | ▶ | sub _rebuild_safe { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_rebuild_safe: called CC=2 SCAR=7.1
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 135 | 9 | my $self = shift; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 136 | 9 | ▶ | $self->_safe($self->_build_safe) if $self->safe_disposable; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 137 | 9 | return; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 138 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 139 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 140 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 141 | 21 | ▶ | sub process { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
process: called CC=19 SCAR=30.6
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 142 | 21 | my ( $self, $template, $tokens ) = @_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 143 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 144 | 21 | ▶ | defined $template | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition44%4/9
defined $template and not builtin::blessed($template) and ref $template || -f $template
defined $template and not builtin::blessed($template)
ref $template or -f $template
MC/DC0%0/4
defined $template and not builtin::blessed($template) and ref $template || -f $template
defined $template
not builtin::blessed($template)
ref $template
-f $template
Truth table40%2/5
A and not(B) and C or D
A= defined $templateB= not builtin::blessed($template)C= ref $templateD= -f $template
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 145 | && !blessed($template) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 146 | && ( ref $template || -f $template ) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 147 | or croak "$template is not a regular file (name) or a string reference"; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 148 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 149 | 21 | ▶ | my $tt = $self->caching | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 2 branches
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 150 | ? $self->_cache->get( ref $template ? $$template : $template ) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 151 | : undef; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 152 | 21 | ▶ | unless ($tt) { # either we don't cache or the cached instance expired | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 153 | 19 | ▶ | $tt = Text::Template->new( | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 2 branches
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 154 | TYPE => ref $template ? 'STRING' : 'FILE', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 155 | SOURCE => ref $template ? $$template : $template, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 156 | DELIMITERS => $self->delimiters, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 157 | ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 158 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 159 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 160 | 21 | ▶ | my $computed = $tt->fill_in( | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 2 branches
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 161 | HASH => $tokens, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 162 | PREPEND => $self->prepend . _declare_arg_variables($tokens), | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 163 | $self->safe ? ( SAFE => $self->_safe ) : (), | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 164 | ) or our $ERROR = $Text::Template::ERROR; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 165 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 166 | 21 | ▶ | $self->_rebuild_safe if $self->safe && $self->safe_disposable; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition66%2/3
$self->safe and $self->safe_disposable
MC/DC50%1/2
$self->safe and $self->safe_disposable
$self->safe
$self->safe_disposable
Truth table66%2/3
A and B
A= $self->safeB= $self->safe_disposable
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 167 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 168 | 21 | ▶ | if ( defined $computed && $self->caching ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition100%3/3
defined $computed and $self->caching
MC/DC100%2/2
defined $computed and $self->caching
defined $computed
$self->caching
Truth table100%3/3
A and B
A= defined $computedB= $self->caching
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 169 | 5 | ▶ | if ( ref $template && $self->cache_stringrefs ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition66%2/3
ref $template and $self->cache_stringrefs
MC/DC50%1/2
ref $template and $self->cache_stringrefs
ref $template
$self->cache_stringrefs
Truth table66%2/3
A and B
A= ref $templateB= $self->cache_stringrefs
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 170 | 2 | $self->_cache->set( $$template, $tt, 'never' ); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 171 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 172 | else { # filenames | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 173 | 3 | ▶ | $self->_cache->set( $template, $tt, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 174 | $self->expires > 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 175 | ? { expires_in => $self->expires } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 176 | : 'never' ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 177 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 178 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 179 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 180 | 21 | return $computed; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 181 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 182 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 183 | 5 | 1; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 184 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 185 | __END__ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||