Subject: | Template::Provider constructor compatibility patch |
Current version of Template::Provider wants a hashref passed as
argument, not a hash; patch attached.
Subject: | Template-Provider-Preload.pm-0.05-ConstructorCompat.diff |
--- Preload.pm-0.05 2010-05-19 17:16:31.000000000 +0200
+++ Preload.pm 2010-05-21 09:12:01.000000000 +0200
@@ -10,7 +10,7 @@
my $template = Template->new(
LOAD_TEMPLATES => [
- Template::Provider::Preload->new(
+ Template::Provider::Preload->new({
PRECACHE => 1,
PREFETCH => '*.tt',
INCLUDE_PATH => 'my/templates',
@@ -20,7 +20,7 @@
# parent Template constructor.
INTERPOLATE => 1,
PRE_CHOMP => 1,
- );
+ });
],
);
@@ -180,12 +180,12 @@
=head2 new
- my $provider = Template::Provider::Preload->new(
+ my $provider = Template::Provider::Preload->new({
PRECACHE => 1,
PREFETCH => '*.tt',
INCLUDE_PATH => 'my/templates',
COMPILE_DIR => 'my/cache',
- );
+ });
The C<new> constructor accepts all the same parameters as the underlying
L<Template::Provider> class, with two additions.
@@ -213,13 +213,13 @@
sub new {
my $class = shift;
- my %param = @_;
- my $precache = delete $param{PRECACHE};
- my $prefetch = delete $param{PREFETCH};
+ my $param = shift;
+ my $precache = delete $param->{PRECACHE};
+ my $prefetch = delete $param->{PREFETCH};
# Create the provider as normal
my $self = $class->SUPER::new(
- Template::Provider->new(%param),
+ Template::Provider->new($param),
);
# Create the precache if needed