[Templates-cvs] cvs commit: TT3/lib/Template Factory.pm

cvs@template-toolkit.org cvs@template-toolkit.org
Sat, 11 Dec 2004 13:59:51 +0000


cvs         04/12/11 13:59:51

  Modified:    lib/Template Factory.pm
  Log:
  * removed name config option
  
  Revision  Changes    Path
  1.5       +12 -6     TT3/lib/Template/Factory.pm
  
  Index: Factory.pm
  ===================================================================
  RCS file: /template-toolkit/TT3/lib/Template/Factory.pm,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- Factory.pm	2004/12/10 12:32:25	1.4
  +++ Factory.pm	2004/12/11 13:59:51	1.5
  @@ -18,7 +18,7 @@
   #   modify it under the same terms as Perl itself.
   #
   # REVISION
  -#   $Id: Factory.pm,v 1.4 2004/12/10 12:32:25 abw Exp $
  +#   $Id: Factory.pm,v 1.5 2004/12/11 13:59:51 abw Exp $
   #
   #========================================================================
   
  @@ -30,7 +30,7 @@
   use Template::Base;
   use base qw( Template::Base );
   
  -our $VERSION   = sprintf("%d.%02d", q$Revision: 1.4 $ =~ /(\d+)\.(\d+)/);
  +our $VERSION   = sprintf("%d.%02d", q$Revision: 1.5 $ =~ /(\d+)\.(\d+)/);
   our $DEBUG     = 0 unless defined $DEBUG;
   our $ERROR     = '';
   our $THROW     = 'factory';         # name used for throwing errors
  @@ -60,9 +60,9 @@
       # are defined in config as C<modules => { ... }>, but this can 
       # be redefined by a subclass, e.g. C<plugins => { ... }>
   
  -    my $name = $self->{ name }
  -             = $config->{ name } 
  -            || $self->pkgvar( NAME => $NAME );
  +    my $name = $self->{ name } = 
  +             # = $config->{ name } ||        # interference
  +             $self->pkgvar( NAME => $NAME );
   
       # merge $MODULES and any other $name items defined in config 
       my $pkgmods = $self->pkgvar( MODULES => $MODULES );
  @@ -72,6 +72,12 @@
           %$cfgmods,
       };
   
  +    if ($DEBUG) {
  +        $self->debug("modules from package: ", $self->dump_hash($pkgmods), "\n");
  +        $self->debug("modules from config ($name): ", $self->dump_hash($cfgmods), "\n");
  +        $self->debug("config: ", $self->dump_hash($config), "\n");
  +    }
  +
       # extract any $config items into separate hash arrays, based on
       # the keys in $modules
       $self->{ config } = $UTILS->hash_extract($config, [ keys %$modules ]);
  @@ -455,7 +461,7 @@
   
   =head1 VERSION
   
  -$Revision: 1.4 $
  +$Revision: 1.5 $
   
   =head1 COPYRIGHT