burak / CPAN-Text-Template-Simple (http://search.cpan.org/~burak/Text-Template-Simple/)
Simple text template engine for Perl
Clone this repository (size: 294.4 KB): HTTPS / SSH
$ hg clone http://bitbucket.org/burak/cpan-text-template-simple/
| commit 168: | e5fc2996193a |
| parent 167: | 1684af10140e |
| branch: | default |
| tags: | tip |
minor fixes
- View burak's profile
-
burak's public repos »
- CPAN-Padre-Plugin-HG
- CPAN-Net-Bitbucket
- CPAN-GD-SecurityImage
- CPAN-Lingua-TR-Numbers
- CPAN-Sys-Info-Driver-Windows
- CPAN-Task-Lingua-Any-Numbers
- CPAN-Time-Elapsed
- CPAN-Win32-ASP-CGI
- CPAN-Scalar-Util-Reftype
- CPAN-Parse-HTTP-UserAgent
- CPAN-Acme-CPANAuthors-Turkish
- CPAN-tools
- CPAN-Device-CableModem-Motorola-SB4200
- CPAN-Text-Template-Simple
- CPAN-CGI-Auth-Basic
- CPAN-GD-Thumbnail
- CPAN-Lingua-Any-Numbers
- CPAN-MP3-M3U-Parser
- CPAN-PHP-Session-DBI
- CPAN-Sys-Info
- CPAN-Sys-Info-Base
- CPAN-Sys-Info-Driver-BSD
- CPAN-Sys-Info-Driver-Linux
- CPAN-Sys-Info-Driver-Unknown
- CPAN-Test-Sys-Info
- Send message
4 months ago
Changed (Δ93 bytes):
raw changeset »
lib/Text/Template/Simple/Base/Examine.pm (5 lines added, 7 lines removed)
lib/Text/Template/Simple/Base/Parser.pm (1 lines added, 0 lines removed)
lib/Text/Template/Simple/Cache.pm (2 lines added, 3 lines removed)
lib/Text/Template/Simple/Constants.pm (1 lines added, 1 lines removed)
Up to file-list lib/Text/Template/Simple/Base/Examine.pm:
| … | … | @@ -40,12 +40,10 @@ sub _examine { |
40 |
40 |
} |
41 |
41 |
|
42 |
42 |
sub _examine_glob { |
43 |
my $self = shift; |
|
44 |
my $TMP = shift; |
|
45 |
my $ref = ref $TMP; |
|
46 |
fatal( 'tts.base.examine.notglob' => $ref ) if $ref ne 'GLOB'; |
|
47 |
fatal( 'tts.base.examine.notfh' ) if not fileno $TMP; |
|
48 |
return $self->io->slurp( $TMP ); |
|
43 |
my($self, $thing) = @_; |
|
44 |
fatal( 'tts.base.examine.notglob' => ref $thing ) if ref $thing ne 'GLOB'; |
|
45 |
fatal( 'tts.base.examine.notfh' ) if ! fileno $thing; |
|
46 |
return $self->io->slurp( $thing ); |
|
49 |
47 |
} |
50 |
48 |
|
51 |
49 |
sub _examine_type { |
| … | … | @@ -59,7 +57,7 @@ sub _examine_type { |
59 |
57 |
if ( isaref( $TMP ) ) { |
60 |
58 |
my $ftype = shift @{ $TMP } || fatal('tts.base.examine._examine_type.ftype'); |
61 |
59 |
my $fthing = shift @{ $TMP } || fatal('tts.base.examine._examine_type.fthing'); |
62 |
fatal('tts.base.examine._examine_type.extra') if @{ $TMP } |
|
60 |
fatal('tts.base.examine._examine_type.extra') if @{ $TMP }; |
|
63 |
61 |
return uc $ftype, $fthing; |
64 |
62 |
} |
65 |
63 |
Up to file-list lib/Text/Template/Simple/Base/Parser.pm:
| … | … | @@ -10,6 +10,7 @@ use Text::Template::Simple::Constants qw |
10 |
10 |
use constant MAPKEY_NUM => 5; |
11 |
11 |
|
12 |
12 |
my %INTERNAL = __PACKAGE__->_set_internal_templates; |
13 |
my %BLOCK; # block registry |
|
13 |
14 |
|
14 |
15 |
sub _needs_object { |
15 |
16 |
my $self = shift; |
Up to file-list lib/Text/Template/Simple/Cache.pm:
| … | … | @@ -274,9 +274,8 @@ sub hit { |
274 |
274 |
my $cache_id = shift; |
275 |
275 |
my $chkmt = shift || 0; |
276 |
276 |
|
277 |
return $self->[CACHE_PARENT][CACHE_DIR] |
|
278 |
? $self->_hit_disk( $cache_id, $chkmt ) |
|
279 |
|
|
277 |
my $method = $self->[CACHE_PARENT][CACHE_DIR] ? '_hit_disk' : '_hit_memory'; |
|
278 |
return $self->$method( $cache_id, $chkmt ); |
|
280 |
279 |
} |
281 |
280 |
|
282 |
281 |
sub _hit_memory { |
Up to file-list lib/Text/Template/Simple/Constants.pm:
| … | … | @@ -150,7 +150,7 @@ use constant DIGEST_MODS => qw( |
150 |
150 |
Digest::Perl::MD5 |
151 |
151 |
); |
152 |
152 |
|
153 |
use constant RE_PIPE_SPLIT => qr/ \| (?:\s+)? ( |
|
153 |
use constant RE_PIPE_SPLIT => qr/ \| (?:\s+)? (NAME|PARAM|FILTER|SHARE) : /xms; |
|
154 |
154 |
use constant RE_FILTER_SPLIT => qr/ \, (?:\s+)? /xms; |
155 |
155 |
use constant RE_INVALID_CID => qr{[^A-Za-z_0-9]}xms; |
156 |
156 |
