summaryrefslogtreecommitdiffstats
path: root/lib/Text/Handlebars.pm
diff options
context:
space:
mode:
authorJesse Luehrs <doy@tozt.net>2012-10-19 03:32:22 -0500
committerJesse Luehrs <doy@tozt.net>2013-01-02 13:56:21 -0600
commit271ae740506b9b64119494a3a34bfe8a9786037e (patch)
tree4e0e835fb6a50d60f5cbb1b6e148ac00fceabe9f /lib/Text/Handlebars.pm
parentaf336052276fd8d61b4c61a22ec77732083667c2 (diff)
downloadtext-handlebars-271ae740506b9b64119494a3a34bfe8a9786037e.tar.gz
text-handlebars-271ae740506b9b64119494a3a34bfe8a9786037e.zip
move most of find_file into the compiler
Diffstat (limited to 'lib/Text/Handlebars.pm')
-rw-r--r--lib/Text/Handlebars.pm8
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/Text/Handlebars.pm b/lib/Text/Handlebars.pm
index 9e3f93c..947a336 100644
--- a/lib/Text/Handlebars.pm
+++ b/lib/Text/Handlebars.pm
@@ -143,12 +143,12 @@ sub _register_builtin_methods {
my ($funcs) = @_;
weaken(my $weakself = $self);
+ $funcs->{'(suffix)'} = sub {
+ return $weakself->{suffix};
+ };
$funcs->{'(find_file)'} = sub {
my ($filename) = @_;
- return $filename if try { $weakself->find_file($filename); 1 };
- $filename .= $weakself->{suffix};
- return $filename if try { $weakself->find_file($filename); 1 };
- return 0;
+ return try { $weakself->find_file($filename); 1 };
};
$funcs->{'(make_block_helper)'} = sub {
my ($code, $raw_text, $else_raw_text, $hash) = @_;