[Jifty-commit] r3309 - Template-Declare/lib/Template

jifty-commit at lists.jifty.org jifty-commit at lists.jifty.org
Tue May 29 18:53:18 EDT 2007


Author: clkao
Date: Tue May 29 18:53:18 2007
New Revision: 3309

Modified:
   Template-Declare/lib/Template/Declare.pm

Log:
When doing import_templates, walk ISA properly instead of just one level.

Modified: Template-Declare/lib/Template/Declare.pm
==============================================================================
--- Template-Declare/lib/Template/Declare.pm	(original)
+++ Template-Declare/lib/Template/Declare.pm	Tue May 29 18:53:18 2007
@@ -5,6 +5,7 @@
 
 package Template::Declare;
 use Template::Declare::Buffer;
+use Class::ISA;
 
 $Template::Declare::VERSION = "0.21";
 
@@ -248,11 +249,9 @@
     $prepend_path =~ s|/$||;
     $import_from_base->imported_into($prepend_path);
 
-    my @packages;
-    {
-        no strict 'refs';
-        @packages = ( @{ $import_from_base . "::ISA" }, $import_from_base );
-    }
+    my @packages = reverse grep { $_->isa('Template::Declare') }
+        Class::ISA::self_and_super_path( $import_from_base );
+
     foreach my $import_from (@packages) {
         foreach my $template_name ( @{ __PACKAGE__->templates()->{$import_from} } ) {
             my $code = $import_from->_find_template_sub( _template_name_to_sub($template_name));


More information about the Jifty-commit mailing list