Skip Menu |

This queue is for tickets about the Template-Provider-Preload CPAN distribution.

Report information
The Basics
Id: 59417
Status: new
Priority: 0/
Queue: Template-Provider-Preload

People
Owner: Nobody in particular
Requestors: PEPL [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Important
Broken in: 0.05
Fixed in: (no value)



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
Now with patched test cases included
Subject: Template-Provider-Preload.pm-0.05-ConstructorCompat-withtests.diff
Only in Template-Provider-Preload-0.05: blib diff -rub Template-Provider-Preload-0.05-orig/lib/Template/Provider/Preload.pm Template-Provider-Preload-0.05/lib/Template/Provider/Preload.pm --- Template-Provider-Preload-0.05-orig/lib/Template/Provider/Preload.pm 2008-09-25 06:35:39.000000000 +0200 +++ Template-Provider-Preload-0.05/lib/Template/Provider/Preload.pm 2010-07-15 18:30:38.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 Only in Template-Provider-Preload-0.05: pm_to_blib diff -rub Template-Provider-Preload-0.05-orig/t/02_concept.t Template-Provider-Preload-0.05/t/02_concept.t --- Template-Provider-Preload-0.05-orig/t/02_concept.t 2010-07-15 18:32:13.000000000 +0200 +++ Template-Provider-Preload-0.05/t/02_concept.t 2010-07-15 18:32:40.000000000 +0200 @@ -17,12 +17,12 @@ ok( -d $COMPILE_DIR, 'Found compile directory' ); # Create the preloader -my $provider = Template::Provider::Preload->new( +my $provider = Template::Provider::Preload->new({ DEBUG => 1, STAT_TTL => 1, INCLUDE_PATH => $INCLUDE_PATH, # COMPILE_DIR => $COMPILE_DIR, -); +}); isa_ok( $provider, 'Template::Provider' ); # Can we get the transformed paths diff -rub Template-Provider-Preload-0.05-orig/t/03_precache.t Template-Provider-Preload-0.05/t/03_precache.t --- Template-Provider-Preload-0.05-orig/t/03_precache.t 2010-07-15 18:32:13.000000000 +0200 +++ Template-Provider-Preload-0.05/t/03_precache.t 2010-07-15 18:32:58.000000000 +0200 @@ -19,12 +19,12 @@ ok( -d $COMPILE_DIR, 'Found compile directory' ); # Create the preloader -my $provider = Template::Provider::Preload->new( +my $provider = Template::Provider::Preload->new({ CACHE_SIZE => 10, PRECACHE => 1, INCLUDE_PATH => $INCLUDE_PATH, # COMPILE_DIR => $COMPILE_DIR, -); +}); isa_ok( $provider, 'Template::Provider' ); isa_ok( $provider->_OBJECT_, 'Template::Provider' ); is_deeply( Only in Template-Provider-Preload-0.05-orig/: Template-Provider-Preload.pm-0.05-ConstructorCompat.diff