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

cvs@template-toolkit.org cvs@template-toolkit.org
Wed, 10 Nov 2004 18:10:36 +0000


cvs         04/11/10 18:10:36

  Modified:    lib/Template Base.pm
  Log:
  * added support for regexen in dump_item()
  
  Revision  Changes    Path
  1.6       +7 -3      TT3/lib/Template/Base.pm
  
  Index: Base.pm
  ===================================================================
  RCS file: /template-toolkit/TT3/lib/Template/Base.pm,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- Base.pm	2004/11/08 18:46:27	1.5
  +++ Base.pm	2004/11/10 18:10:36	1.6
  @@ -18,7 +18,7 @@
   #   modify it under the same terms as Perl itself.
   #
   # REVISION
  -#   $Id: Base.pm,v 1.5 2004/11/08 18:46:27 abw Exp $
  +#   $Id: Base.pm,v 1.6 2004/11/10 18:10:36 abw Exp $
   #
   #========================================================================
   
  @@ -33,7 +33,7 @@
   require Template::Utils;
   require Template::Exception;
   
  -$VERSION   = sprintf("%d.%02d", q$Revision: 1.5 $ =~ /(\d+)\.(\d+)/);
  +$VERSION   = sprintf("%d.%02d", q$Revision: 1.6 $ =~ /(\d+)\.(\d+)/);
   $DEBUG     = 0 unless defined $DEBUG;
   $ERROR     = '';
   $PAD       = '  ';
  @@ -582,10 +582,14 @@
       elsif (UNIVERSAL::isa($item, 'ARRAY')) {
           return $self->dump_list($item, $indent);
       }
  +    elsif (UNIVERSAL::isa($item, 'Regexp')) {
  +        return $self->dump_text("$item");
  +    }
       elsif (UNIVERSAL::isa($item, 'SCALAR')) {
           return $self->dump_text($item);
       }
       else {
  +        print STDERR "unknown item: $item\n";
           return $item;
       }
   }
  @@ -1106,7 +1110,7 @@
   
   =head1 VERSION
   
  -$Revision: 1.5 $
  +$Revision: 1.6 $
   
   =head1 COPYRIGHT