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

cvs@template-toolkit.org cvs@template-toolkit.org
Fri, 03 Dec 2004 13:40:09 +0000


cvs         04/12/03 13:40:09

  Modified:    lib/Template/Generator Debug.pm
  Log:
  * added generate_path() and generate_paths()
  
  Revision  Changes    Path
  1.14      +21 -3     TT3/lib/Template/Generator/Debug.pm
  
  Index: Debug.pm
  ===================================================================
  RCS file: /template-toolkit/TT3/lib/Template/Generator/Debug.pm,v
  retrieving revision 1.13
  retrieving revision 1.14
  diff -u -r1.13 -r1.14
  --- Debug.pm	2004/12/02 17:41:14	1.13
  +++ Debug.pm	2004/12/03 13:40:09	1.14
  @@ -16,7 +16,7 @@
   #   modify it under the same terms as Perl itself.
   #
   # REVISION
  -#   $Id: Debug.pm,v 1.13 2004/12/02 17:41:14 abw Exp $
  +#   $Id: Debug.pm,v 1.14 2004/12/03 13:40:09 abw Exp $
   #
   #========================================================================
   
  @@ -27,7 +27,7 @@
   use Template::Generator;
   use base qw( Template::Generator );
   
  -our $VERSION  = sprintf("%d.%02d", q$Revision: 1.13 $ =~ /(\d+)\.(\d+)/);
  +our $VERSION  = sprintf("%d.%02d", q$Revision: 1.14 $ =~ /(\d+)\.(\d+)/);
   our $DEBUG    = 0 unless defined $DEBUG;
   our $ERROR    = '';
   our $DEFAULT  = '_default';
  @@ -77,6 +77,24 @@
   }
   
   
  +sub generate_path {
  +    my ($self, $path) = @_;
  +    return "<path:$path>";
  +}
  +
  +sub generate_paths {
  +    my ($self, $paths) = @_;
  +    my $out = '';
  +
  +    foreach my $path (@$paths) {
  +        my $tmp = $self->generate($path);
  +        $tmp =~ s/\n/\n  /g;
  +        $out .= "  $tmp\n";
  +    }
  +    return "<paths:\n$out>";
  +}
  +
  +
   sub generate_tuple {
       my ($self, $name, $value) = @_;
       $value = $self->generate($value);
  @@ -546,7 +564,7 @@
   
   =head1 VERSION
   
  -$Revision: 1.13 $
  +$Revision: 1.14 $
   
   =head1 COPYRIGHT