[Templates-cvs] cvs commit: Template2/lib/Template Base.pm Config.pm Constants.pm Context.pm Document.pm Exception.pm FAQ.pod Iterator.pm Manual.pod Modules.pod Parser.pm Plugin.pm Plugins.pm Provider.pm Service.pm Stash.pm Test.pm Tutorial.pod
cvs@template-toolkit.org
cvs@template-toolkit.org
cvs 06/05/30 15:53:16
Modified: lib/Template Base.pm Config.pm Constants.pm Context.pm
Document.pm Exception.pm FAQ.pod Iterator.pm
Manual.pod Modules.pod Parser.pm Plugin.pm
Plugins.pm Provider.pm Service.pm Stash.pm Test.pm
Tutorial.pod
Log:
Rebuild in preparation for 2.15b
Revision Changes Path
2.76 +4 -4 Template2/lib/Template/Base.pm
Index: Base.pm
===================================================================
RCS file: /template-toolkit/Template2/lib/Template/Base.pm,v
retrieving revision 2.75
retrieving revision 2.76
diff -u -r2.75 -r2.76
--- Base.pm 2006/05/29 08:54:30 2.75
+++ Base.pm 2006/05/30 15:53:07 2.76
@@ -17,7 +17,7 @@
# modify it under the same terms as Perl itself.
#
# REVISION
-# $Id: Base.pm,v 2.75 2006/05/29 08:54:30 abw Exp $
+# $Id: Base.pm,v 2.76 2006/05/30 15:53:07 abw Exp $
#
#========================================================================
@@ -27,7 +27,7 @@
use warnings;
use Template::Constants;
-our $VERSION = sprintf("%d.%02d", q$Revision: 2.75 $ =~ /(\d+)\.(\d+)/);
+our $VERSION = sprintf("%d.%02d", q$Revision: 2.76 $ =~ /(\d+)\.(\d+)/);
#------------------------------------------------------------------------
@@ -283,8 +283,8 @@
=head1 VERSION
-2.71, distributed as part of the
-Template Toolkit version 2.15, released on 26 May 2006.
+2.75, distributed as part of the
+Template Toolkit version 2.15b, released on 30 May 2006.
=head1 COPYRIGHT
2.73 +4 -4 Template2/lib/Template/Config.pm
Index: Config.pm
===================================================================
RCS file: /template-toolkit/Template2/lib/Template/Config.pm,v
retrieving revision 2.72
retrieving revision 2.73
diff -u -r2.72 -r2.73
--- Config.pm 2006/05/29 08:51:48 2.72
+++ Config.pm 2006/05/30 15:53:10 2.73
@@ -15,7 +15,7 @@
# modify it under the same terms as Perl itself.
#
# REVISION
-# $Id: Config.pm,v 2.72 2006/05/29 08:51:48 abw Exp $
+# $Id: Config.pm,v 2.73 2006/05/30 15:53:10 abw Exp $
#
#========================================================================
@@ -29,7 +29,7 @@
$LATEX_PATH $PDFLATEX_PATH $DVIPS_PATH
$STASH $SERVICE $CONTEXT $CONSTANTS @PRELOAD );
-$VERSION = sprintf("%d.%02d", q$Revision: 2.72 $ =~ /(\d+)\.(\d+)/);
+$VERSION = sprintf("%d.%02d", q$Revision: 2.73 $ =~ /(\d+)\.(\d+)/);
$DEBUG = 0 unless defined $DEBUG;
$ERROR = '';
$CONTEXT = 'Template::Context';
@@ -421,8 +421,8 @@
=head1 VERSION
-2.70, distributed as part of the
-Template Toolkit version 2.15, released on 26 May 2006.
+2.72, distributed as part of the
+Template Toolkit version 2.15b, released on 30 May 2006.
=head1 COPYRIGHT
2.73 +4 -4 Template2/lib/Template/Constants.pm
Index: Constants.pm
===================================================================
RCS file: /template-toolkit/Template2/lib/Template/Constants.pm,v
retrieving revision 2.72
retrieving revision 2.73
diff -u -r2.72 -r2.73
--- Constants.pm 2006/05/26 13:45:34 2.72
+++ Constants.pm 2006/05/30 15:53:11 2.73
@@ -16,7 +16,7 @@
# modify it under the same terms as Perl itself.
#
# REVISION
-# $Id: Constants.pm,v 2.72 2006/05/26 13:45:34 abw Exp $
+# $Id: Constants.pm,v 2.73 2006/05/30 15:53:11 abw Exp $
#
#============================================================================
@@ -31,7 +31,7 @@
use vars qw( @EXPORT_OK %EXPORT_TAGS );
use vars qw( $DEBUG_OPTIONS @STATUS @ERROR @CHOMP @DEBUG);
-our $VERSION = sprintf("%d.%02d", q$Revision: 2.72 $ =~ /(\d+)\.(\d+)/);
+our $VERSION = sprintf("%d.%02d", q$Revision: 2.73 $ =~ /(\d+)\.(\d+)/);
#========================================================================
@@ -265,8 +265,8 @@
=head1 VERSION
-2.71, distributed as part of the
-Template Toolkit version 2.15, released on 26 May 2006.
+2.72, distributed as part of the
+Template Toolkit version 2.15b, released on 30 May 2006.
=head1 COPYRIGHT
2.98 +4 -4 Template2/lib/Template/Context.pm
Index: Context.pm
===================================================================
RCS file: /template-toolkit/Template2/lib/Template/Context.pm,v
retrieving revision 2.97
retrieving revision 2.98
diff -u -r2.97 -r2.98
--- Context.pm 2006/05/26 13:45:34 2.97
+++ Context.pm 2006/05/30 15:53:11 2.98
@@ -18,7 +18,7 @@
# modify it under the same terms as Perl itself.
#
# REVISION
-# $Id: Context.pm,v 2.97 2006/05/26 13:45:34 abw Exp $
+# $Id: Context.pm,v 2.98 2006/05/30 15:53:11 abw Exp $
#
#============================================================================
@@ -35,7 +35,7 @@
use Template::Constants;
use Template::Exception;
-$VERSION = sprintf("%d.%02d", q$Revision: 2.97 $ =~ /(\d+)\.(\d+)/);
+$VERSION = sprintf("%d.%02d", q$Revision: 2.98 $ =~ /(\d+)\.(\d+)/);
$DEBUG_FORMAT = "\n## \$file line \$line : [% \$text %] ##\n";
@@ -1551,8 +1551,8 @@
=head1 VERSION
-2.96, distributed as part of the
-Template Toolkit version 2.15, released on 26 May 2006.
+2.97, distributed as part of the
+Template Toolkit version 2.15b, released on 30 May 2006.
=head1 COPYRIGHT
2.78 +4 -4 Template2/lib/Template/Document.pm
Index: Document.pm
===================================================================
RCS file: /template-toolkit/Template2/lib/Template/Document.pm,v
retrieving revision 2.77
retrieving revision 2.78
diff -u -r2.77 -r2.78
--- Document.pm 2006/05/26 13:45:35 2.77
+++ Document.pm 2006/05/30 15:53:11 2.78
@@ -20,7 +20,7 @@
#
#----------------------------------------------------------------------------
#
-# $Id: Document.pm,v 2.77 2006/05/26 13:45:35 abw Exp $
+# $Id: Document.pm,v 2.78 2006/05/30 15:53:11 abw Exp $
#
#============================================================================
@@ -33,7 +33,7 @@
use base qw( Template::Base );
use Template::Constants;
-$VERSION = sprintf("%d.%02d", q$Revision: 2.77 $ =~ /(\d+)\.(\d+)/);
+$VERSION = sprintf("%d.%02d", q$Revision: 2.78 $ =~ /(\d+)\.(\d+)/);
BEGIN {
# UNICODE is supported in versions of Perl from 5.008 onwards
@@ -487,8 +487,8 @@
=head1 VERSION
-2.76, distributed as part of the
-Template Toolkit version 2.15, released on 26 May 2006.
+2.77, distributed as part of the
+Template Toolkit version 2.15b, released on 30 May 2006.
=head1 COPYRIGHT
2.68 +4 -4 Template2/lib/Template/Exception.pm
Index: Exception.pm
===================================================================
RCS file: /template-toolkit/Template2/lib/Template/Exception.pm,v
retrieving revision 2.67
retrieving revision 2.68
diff -u -r2.67 -r2.68
--- Exception.pm 2006/05/26 13:45:35 2.67
+++ Exception.pm 2006/05/30 15:53:11 2.68
@@ -18,7 +18,7 @@
#
#------------------------------------------------------------------------
#
-# $Id: Exception.pm,v 2.67 2006/05/26 13:45:35 abw Exp $
+# $Id: Exception.pm,v 2.68 2006/05/30 15:53:11 abw Exp $
#
#========================================================================
@@ -36,7 +36,7 @@
use overload q|""| => "as_string", fallback => 1;
-$VERSION = sprintf("%d.%02d", q$Revision: 2.67 $ =~ /(\d+)\.(\d+)/);
+$VERSION = sprintf("%d.%02d", q$Revision: 2.68 $ =~ /(\d+)\.(\d+)/);
#------------------------------------------------------------------------
@@ -228,8 +228,8 @@
=head1 VERSION
-2.66, distributed as part of the
-Template Toolkit version 2.15, released on 26 May 2006.
+2.67, distributed as part of the
+Template Toolkit version 2.15b, released on 30 May 2006.
=head1 COPYRIGHT
2.67 +3 -3 Template2/lib/Template/FAQ.pod
Index: FAQ.pod
===================================================================
RCS file: /template-toolkit/Template2/lib/Template/FAQ.pod,v
retrieving revision 2.66
retrieving revision 2.67
diff -u -r2.66 -r2.67
--- FAQ.pod 2006/05/26 13:45:35 2.66
+++ FAQ.pod 2006/05/30 15:53:11 2.67
@@ -18,7 +18,7 @@
# modify it under the same terms as Perl itself.
#
# REVISION
-# 2.66
+# 2.67
#
#========================================================================
@@ -367,8 +367,8 @@
=head1 VERSION
-2.66, distributed as part of the
-Template Toolkit version 2.15, released on 26 May 2006.
+2.67, distributed as part of the
+Template Toolkit version 2.15b, released on 30 May 2006.
=head1 COPYRIGHT
2.68 +43 -46 Template2/lib/Template/Iterator.pm
Index: Iterator.pm
===================================================================
RCS file: /template-toolkit/Template2/lib/Template/Iterator.pm,v
retrieving revision 2.67
retrieving revision 2.68
diff -u -r2.67 -r2.68
--- Iterator.pm 2006/05/26 13:45:35 2.67
+++ Iterator.pm 2006/05/30 15:53:11 2.68
@@ -38,24 +38,21 @@
# This module is free software; you can redistribute it and/or
# modify it under the same terms as Perl itself.
#
-#----------------------------------------------------------------------------
+# REVISION
+# $Id: Iterator.pm,v 2.68 2006/05/30 15:53:11 abw Exp $
#
-# $Id: Iterator.pm,v 2.67 2006/05/26 13:45:35 abw Exp $
-#
#============================================================================
package Template::Iterator;
-require 5.004;
-
use strict;
-use vars qw( $VERSION $DEBUG $AUTOLOAD ); # AUTO?
-use base qw( Template::Base );
+use base 'Template::Base';
use Template::Constants;
use Template::Exception;
-$VERSION = sprintf("%d.%02d", q$Revision: 2.67 $ =~ /(\d+)\.(\d+)/);
-$DEBUG = 0 unless defined $DEBUG;
+our $VERSION = 2.68;
+our $DEBUG = 0 unless defined $DEBUG;
+our $AUTOLOAD;
#========================================================================
@@ -76,22 +73,22 @@
my $params = shift || { };
if (ref $data eq 'HASH') {
- # map a hash into a list of { key => ???, value => ??? } hashes,
- # one for each key, sorted by keys
- $data = [ map { { key => $_, value => $data->{ $_ } } }
- sort keys %$data ];
+ # map a hash into a list of { key => ???, value => ??? } hashes,
+ # one for each key, sorted by keys
+ $data = [ map { { key => $_, value => $data->{ $_ } } }
+ sort keys %$data ];
}
elsif (UNIVERSAL::can($data, 'as_list')) {
- $data = $data->as_list();
+ $data = $data->as_list();
}
elsif (ref $data ne 'ARRAY') {
- # coerce any non-list data into an array reference
- $data = [ $data ] ;
+ # coerce any non-list data into an array reference
+ $data = [ $data ] ;
}
bless {
- _DATA => $data,
- _ERROR => '',
+ _DATA => $data,
+ _ERROR => '',
}, $class;
}
@@ -144,22 +141,22 @@
# warn about incorrect usage
unless (defined $index) {
- my ($pack, $file, $line) = caller();
- warn("iterator get_next() called before get_first() at $file line $line\n");
- return (undef, Template::Constants::STATUS_DONE); ## RETURN ##
+ my ($pack, $file, $line) = caller();
+ warn("iterator get_next() called before get_first() at $file line $line\n");
+ return (undef, Template::Constants::STATUS_DONE); ## RETURN ##
}
# if there's still some data to go...
if ($index < $max) {
- # update counters and flags
- $index++;
- @$self{ qw( INDEX COUNT FIRST LAST ) }
- = ( $index, $index + 1, 0, $index == $max ? 1 : 0 );
- @$self{ qw( PREV NEXT ) } = @$data[ $index - 1, $index + 1 ];
- return $data->[ $index ]; ## RETURN ##
+ # update counters and flags
+ $index++;
+ @$self{ qw( INDEX COUNT FIRST LAST ) }
+ = ( $index, $index + 1, 0, $index == $max ? 1 : 0 );
+ @$self{ qw( PREV NEXT ) } = @$data[ $index - 1, $index + 1 ];
+ return $data->[ $index ]; ## RETURN ##
}
else {
- return (undef, Template::Constants::STATUS_DONE); ## RETURN ##
+ return (undef, Template::Constants::STATUS_DONE); ## RETURN ##
}
}
@@ -181,17 +178,17 @@
# if there's still some data to go...
if ($index < $max) {
- $index++;
- @data = @{ $self->{ _DATASET } } [ $index..$max ];
-
- # update counters and flags
- @$self{ qw( INDEX COUNT FIRST LAST ) }
- = ( $max, $max + 1, 0, 1 );
+ $index++;
+ @data = @{ $self->{ _DATASET } } [ $index..$max ];
+
+ # update counters and flags
+ @$self{ qw( INDEX COUNT FIRST LAST ) }
+ = ( $max, $max + 1, 0, 1 );
- return \@data; ## RETURN ##
+ return \@data; ## RETURN ##
}
else {
- return (undef, Template::Constants::STATUS_DONE); ## RETURN ##
+ return (undef, Template::Constants::STATUS_DONE); ## RETURN ##
}
}
@@ -229,14 +226,14 @@
sub _dump {
my $self = shift;
join('',
- " Data: ", $self->{ _DATA }, "\n",
- " Index: ", $self->{ INDEX }, "\n",
- "Number: ", $self->{ NUMBER }, "\n",
- " Max: ", $self->{ MAX }, "\n",
- " Size: ", $self->{ SIZE }, "\n",
- " First: ", $self->{ FIRST }, "\n",
- " Last: ", $self->{ LAST }, "\n",
- "\n"
+ " Data: ", $self->{ _DATA }, "\n",
+ " Index: ", $self->{ INDEX }, "\n",
+ "Number: ", $self->{ NUMBER }, "\n",
+ " Max: ", $self->{ MAX }, "\n",
+ " Size: ", $self->{ SIZE }, "\n",
+ " First: ", $self->{ FIRST }, "\n",
+ " Last: ", $self->{ LAST }, "\n",
+ "\n"
);
}
@@ -430,8 +427,8 @@
=head1 VERSION
-2.66, distributed as part of the
-Template Toolkit version 2.15, released on 26 May 2006.
+2.68, distributed as part of the
+Template Toolkit version 2.15b, released on 30 May 2006.
=head1 COPYRIGHT
2.52 +1 -1 Template2/lib/Template/Manual.pod
Index: Manual.pod
===================================================================
RCS file: /template-toolkit/Template2/lib/Template/Manual.pod,v
retrieving revision 2.51
retrieving revision 2.52
diff -u -r2.51 -r2.52
--- Manual.pod 2006/05/26 13:45:35 2.51
+++ Manual.pod 2006/05/30 15:53:11 2.52
@@ -157,7 +157,7 @@
=head1 VERSION
-Template Toolkit version 2.15, released on 26 May 2006.
+Template Toolkit version 2.15b, released on 30 May 2006.
=head1 COPYRIGHT
2.53 +1 -1 Template2/lib/Template/Modules.pod
Index: Modules.pod
===================================================================
RCS file: /template-toolkit/Template2/lib/Template/Modules.pod,v
retrieving revision 2.52
retrieving revision 2.53
diff -u -r2.52 -r2.53
--- Modules.pod 2006/05/26 13:45:35 2.52
+++ Modules.pod 2006/05/30 15:53:11 2.53
@@ -299,7 +299,7 @@
=head1 VERSION
-Template Toolkit version 2.15, released on 26 May 2006.
+Template Toolkit version 2.15b, released on 30 May 2006.
=head1 COPYRIGHT
2.88 +4 -4 Template2/lib/Template/Parser.pm
Index: Parser.pm
===================================================================
RCS file: /template-toolkit/Template2/lib/Template/Parser.pm,v
retrieving revision 2.87
retrieving revision 2.88
diff -u -r2.87 -r2.88
--- Parser.pm 2006/05/26 13:45:35 2.87
+++ Parser.pm 2006/05/30 15:53:11 2.88
@@ -30,7 +30,7 @@
# specified in the Perl README file.
#
# REVISION
-# $Id: Parser.pm,v 2.87 2006/05/26 13:45:35 abw Exp $
+# $Id: Parser.pm,v 2.88 2006/05/30 15:53:11 abw Exp $
#
#============================================================================
@@ -50,7 +50,7 @@
use constant ERROR => 2;
use constant ABORT => 3;
-our $VERSION = sprintf("%d.%02d", q$Revision: 2.87 $ =~ /(\d+)\.(\d+)/);
+our $VERSION = sprintf("%d.%02d", q$Revision: 2.88 $ =~ /(\d+)\.(\d+)/);
our $DEBUG = 0 unless defined $DEBUG;
our $ERROR = '';
@@ -1466,8 +1466,8 @@
=head1 VERSION
-2.86, distributed as part of the
-Template Toolkit version 2.15, released on 26 May 2006.
+2.87, distributed as part of the
+Template Toolkit version 2.15b, released on 30 May 2006.
2.69 +4 -4 Template2/lib/Template/Plugin.pm
Index: Plugin.pm
===================================================================
RCS file: /template-toolkit/Template2/lib/Template/Plugin.pm,v
retrieving revision 2.68
retrieving revision 2.69
diff -u -r2.68 -r2.69
--- Plugin.pm 2006/05/26 13:45:35 2.68
+++ Plugin.pm 2006/05/30 15:53:11 2.69
@@ -19,7 +19,7 @@
#
#----------------------------------------------------------------------------
#
-# $Id: Plugin.pm,v 2.68 2006/05/26 13:45:35 abw Exp $
+# $Id: Plugin.pm,v 2.69 2006/05/30 15:53:11 abw Exp $
#
#============================================================================
@@ -33,7 +33,7 @@
use vars qw( $VERSION $DEBUG $ERROR $AUTOLOAD );
use base qw( Template::Base );
-$VERSION = sprintf("%d.%02d", q$Revision: 2.68 $ =~ /(\d+)\.(\d+)/);
+$VERSION = sprintf("%d.%02d", q$Revision: 2.69 $ =~ /(\d+)\.(\d+)/);
$DEBUG = 0;
@@ -383,8 +383,8 @@
=head1 VERSION
-2.67, distributed as part of the
-Template Toolkit version 2.15, released on 26 May 2006.
+2.68, distributed as part of the
+Template Toolkit version 2.15b, released on 30 May 2006.
=head1 COPYRIGHT
2.76 +6 -4 Template2/lib/Template/Plugins.pm
Index: Plugins.pm
===================================================================
RCS file: /template-toolkit/Template2/lib/Template/Plugins.pm,v
retrieving revision 2.75
retrieving revision 2.76
diff -u -r2.75 -r2.76
--- Plugins.pm 2006/05/26 13:45:35 2.75
+++ Plugins.pm 2006/05/30 15:53:12 2.76
@@ -18,7 +18,7 @@
#
#----------------------------------------------------------------------------
#
-# $Id: Plugins.pm,v 2.75 2006/05/26 13:45:35 abw Exp $
+# $Id: Plugins.pm,v 2.76 2006/05/30 15:53:12 abw Exp $
#
#============================================================================
@@ -29,7 +29,7 @@
use base 'Template::Base';
use Template::Constants;
-our $VERSION = sprintf("%d.%02d", q$Revision: 2.75 $ =~ /(\d+)\.(\d+)/);
+our $VERSION = sprintf("%d.%02d", q$Revision: 2.76 $ =~ /(\d+)\.(\d+)/);
our $DEBUG = 0 unless defined $DEBUG;
our $PLUGIN_BASE = 'Template::Plugin';
our $STD_PLUGINS = {
@@ -46,11 +46,13 @@
'html' => 'Template::Plugin::HTML',
'image' => 'Template::Plugin::Image',
'iterator' => 'Template::Plugin::Iterator',
+ 'latex' => 'Template::Plugin::Latex',
'pod' => 'Template::Plugin::Pod',
'table' => 'Template::Plugin::Table',
'url' => 'Template::Plugin::URL',
'view' => 'Template::Plugin::View',
'wrap' => 'Template::Plugin::Wrap',
+ 'xml' => 'Template::Plugin::XML',
'xmlstyle' => 'Template::Plugin::XML::Style',
};
@@ -864,8 +866,8 @@
=head1 VERSION
-2.74, distributed as part of the
-Template Toolkit version 2.15, released on 26 May 2006.
+2.75, distributed as part of the
+Template Toolkit version 2.15b, released on 30 May 2006.
=head1 COPYRIGHT
2.90 +6 -7 Template2/lib/Template/Provider.pm
Index: Provider.pm
===================================================================
RCS file: /template-toolkit/Template2/lib/Template/Provider.pm,v
retrieving revision 2.89
retrieving revision 2.90
diff -u -r2.89 -r2.90
--- Provider.pm 2006/05/26 13:45:35 2.89
+++ Provider.pm 2006/05/30 15:53:12 2.90
@@ -25,10 +25,9 @@
# * optional provider prefix (e.g. 'http:')
# * fold ABSOLUTE and RELATIVE test cases into one regex?
#
-#----------------------------------------------------------------------------
+# REVISION
+# $Id: Provider.pm,v 2.90 2006/05/30 15:53:12 abw Exp $
#
-# $Id: Provider.pm,v 2.89 2006/05/26 13:45:35 abw Exp $
-#
#============================================================================
package Template::Provider;
@@ -49,7 +48,7 @@
use constant NEXT => 4;
use constant STAT => 5;
-our $VERSION = sprintf("%d.%02d", q$Revision: 2.89 $ =~ /(\d+)\.(\d+)/);
+our $VERSION = sprintf("%d.%02d", q$Revision: 2.90 $ =~ /(\d+)\.(\d+)/);
our $DEBUG = 0 unless defined $DEBUG;
our $ERROR = '';
@@ -679,7 +678,7 @@
}
$data->{ path } = $data->{ name }
- if $data and ref $data and ! defined $data->{ path };
+ if $data && ref $data eq 'HASH' && ! defined $data->{ path };
return ($data, $error);
}
@@ -1509,8 +1508,8 @@
=head1 VERSION
-2.88, distributed as part of the
-Template Toolkit version 2.15, released on 26 May 2006.
+2.89, distributed as part of the
+Template Toolkit version 2.15b, released on 30 May 2006.
=head1 COPYRIGHT
2.81 +58 -58 Template2/lib/Template/Service.pm
Index: Service.pm
===================================================================
RCS file: /template-toolkit/Template2/lib/Template/Service.pm,v
retrieving revision 2.80
retrieving revision 2.81
diff -u -r2.80 -r2.81
--- Service.pm 2006/05/30 07:58:38 2.80
+++ Service.pm 2006/05/30 15:53:12 2.81
@@ -18,7 +18,7 @@
# modify it under the same terms as Perl itself.
#
# REVISION
-# $Id: Service.pm,v 2.80 2006/05/30 07:58:38 abw Exp $
+# $Id: Service.pm,v 2.81 2006/05/30 15:53:12 abw Exp $
#
#============================================================================
@@ -26,7 +26,7 @@
use strict;
use warnings;
-use base 'Template::Base'
+use base 'Template::Base';
use Template::Config;
use Template::Exception;
use Template::Constants;
@@ -125,7 +125,7 @@
delete $params->{ template };
if ($error) {
- # $error = $error->as_string if ref $error;
+ # $error = $error->as_string if ref $error;
return $self->error($error);
}
@@ -209,7 +209,7 @@
if $$error->type() eq 'stop';
my $handlers = $self->{ ERROR }
- || return undef; ## RETURN
+ || return undef; ## RETURN
if (ref $handlers eq 'HASH') {
if ($hkey = $$error->select_handler(keys %$handlers)) {
@@ -221,7 +221,7 @@
$self->debug("using default error handler") if $self->{ DEBUG };
}
else {
- return undef; ## RETURN
+ return undef; ## RETURN
}
}
else {
@@ -232,7 +232,7 @@
eval { $handler = $context->template($handler) };
if ($@) {
$$error = $@;
- return undef; ## RETURN
+ return undef; ## RETURN
};
$context->stash->set('error', $$error);
@@ -241,7 +241,7 @@
};
if ($@) {
$$error = $@;
- return undef; ## RETURN
+ return undef; ## RETURN
}
return $output;
@@ -263,11 +263,11 @@
my $error = $self->{ ERROR };
$error = join('',
- "{\n",
- (map { " $_ => $error->{ $_ }\n" }
- keys %$error),
- "}\n")
- if ref $error;
+ "{\n",
+ (map { " $_ => $error->{ $_ }\n" }
+ keys %$error),
+ "}\n")
+ if ref $error;
local $" = ', ';
return <<EOF;
@@ -305,17 +305,17 @@
use Template::Service;
my $service = Template::Service->new({
- PRE_PROCESS => [ 'config', 'header' ],
- POST_PROCESS => 'footer',
- ERROR => {
- user => 'user/index.html',
- dbi => 'error/database',
- default => 'error/default',
- },
+ PRE_PROCESS => [ 'config', 'header' ],
+ POST_PROCESS => 'footer',
+ ERROR => {
+ user => 'user/index.html',
+ dbi => 'error/database',
+ default => 'error/default',
+ },
});
my $output = $service->process($template_name, \%replace)
- || die $service->error(), "\n";
+ || die $service->error(), "\n";
=head1 DESCRIPTION
@@ -339,8 +339,8 @@
use Template;
my $template = Template->new({
- PRE_PROCESS => 'header',
- POST_PROCESS => 'footer',
+ PRE_PROCESS => 'header',
+ POST_PROCESS => 'footer',
});
Similarly, the Template::Service constructor will forward all configuration
@@ -355,12 +355,12 @@
use Template::Service;
my $service = Template::Service->new({
- PRE_PROCESS => 'header',
- POST_PROCESS => 'footer',
+ PRE_PROCESS => 'header',
+ POST_PROCESS => 'footer',
});
my $template = Template->new({
- SERVICE => $service,
+ SERVICE => $service,
});
The Template::Service module can be sub-classed to create custom service
@@ -370,13 +370,13 @@
use MyOrg::Template::Service;
my $service = MyOrg::Template::Service->new({
- PRE_PROCESS => 'header',
- POST_PROCESS => 'footer',
- COOL_OPTION => 'enabled in spades',
+ PRE_PROCESS => 'header',
+ POST_PROCESS => 'footer',
+ COOL_OPTION => 'enabled in spades',
});
my $template = Template->new({
- SERVICE => $service,
+ SERVICE => $service,
});
The Template module uses the Template::Config service() factory method
@@ -392,9 +392,9 @@
$Template::Config::SERVICE = 'MyOrg::Template::Service';
my $template = Template->new({
- PRE_PROCESS => 'header',
- POST_PROCESS => 'footer',
- COOL_OPTION => 'enabled in spades',
+ PRE_PROCESS => 'header',
+ POST_PROCESS => 'footer',
+ COOL_OPTION => 'enabled in spades',
});
=head1 METHODS
@@ -406,8 +406,8 @@
as a list of (name =E<gt> value) pairs.
my $service1 = Template::Service->new({
- PRE_PROCESS => 'header',
- POST_PROCESS => 'footer',
+ PRE_PROCESS => 'header',
+ POST_PROCESS => 'footer',
});
my $service2 = Template::Service->new( ERROR => 'error.html' );
@@ -418,10 +418,10 @@
$Template::Service::ERROR package variable.
my $service = Template::Service->new(\%config)
- || die Template::Service->error();
+ || die Template::Service->error();
my $service = Template::Service->new(\%config)
- || die $Template::Service::ERROR;
+ || die $Template::Service::ERROR;
The following configuration items may be specified:
@@ -439,16 +439,16 @@
PROCESS, WRAPPER etc.
my $service = Template::Service->new({
- PRE_PROCESS => 'header',
- POST_PROCESS => 'footer',
+ PRE_PROCESS => 'header',
+ POST_PROCESS => 'footer',
};
Multiple templates may be specified as a reference to a list. Each is
processed in the order defined.
my $service = Template::Service->new({
- PRE_PROCESS => [ 'config', 'header' ],
- POST_PROCESS => 'footer',
+ PRE_PROCESS => [ 'config', 'header' ],
+ POST_PROCESS => 'footer',
};
Alternately, multiple template may be specified as a single string,
@@ -456,8 +456,8 @@
DELIMITER option.
my $service = Template::Service->new({
- PRE_PROCESS => 'config:header',
- POST_PROCESS => 'footer',
+ PRE_PROCESS => 'config:header',
+ POST_PROCESS => 'footer',
};
The PRE_PROCESS and POST_PROCESS templates are evaluated in the same
@@ -529,7 +529,7 @@
the use of PRE_PROCESS and POST_PROCESS templates.
my $service = Template::Service->new({
- PROCESS => 'content',
+ PROCESS => 'content',
};
# processes 'content' instead of 'foo.html'
@@ -597,7 +597,7 @@
for all uncaught exceptions.
my $service = Template::Service->new({
- ERROR => 'error.html'
+ ERROR => 'error.html'
});
If the ERROR item is a hash reference the keys are assumed to be
@@ -607,11 +607,11 @@
it more appropriate in this case.
my $service = Template::Service->new({
- ERRORS => {
- user => 'user/index.html',
- dbi => 'error/database',
- default => 'error/default',
- },
+ ERRORS => {
+ user => 'user/index.html',
+ dbi => 'error/database',
+ default => 'error/default',
+ },
});
In this example, any 'user' exceptions thrown will cause the
@@ -627,12 +627,12 @@
string (i.e. C<user.passwd> is parsed as 'user'.'passwd').
my $service = Template::Service->new({
- ERROR => {
- 'user.login' => 'user/login.html',
- 'user.passwd' => 'user/badpasswd.html',
- 'user' => 'user/index.html',
- 'default' => 'error/default',
- },
+ ERROR => {
+ 'user.login' => 'user/login.html',
+ 'user.passwd' => 'user/badpasswd.html',
+ 'user' => 'user/index.html',
+ 'default' => 'error/default',
+ },
});
In this example, any template processed by the $service object, or
@@ -699,7 +699,7 @@
use Template::Constants qw( :debug );
my $template = Template->new({
- DEBUG => DEBUG_SERVICE,
+ DEBUG => DEBUG_SERVICE,
});
@@ -723,7 +723,7 @@
retrieved via the error() method.
$service->process('myfile.html', { title => 'My Test File' })
- || die $service->error();
+ || die $service->error();
=head2 context()
@@ -747,7 +747,7 @@
=head1 VERSION
2.89, distributed as part of the
-Template Toolkit version 2.15a, released on 29 May 2006.
+Template Toolkit version 2.15b, released on 30 May 2006.
=head1 COPYRIGHT
2.104 +27 -326 Template2/lib/Template/Stash.pm
Index: Stash.pm
===================================================================
RCS file: /template-toolkit/Template2/lib/Template/Stash.pm,v
retrieving revision 2.103
retrieving revision 2.104
diff -u -r2.103 -r2.104
--- Stash.pm 2006/05/26 13:45:35 2.103
+++ Stash.pm 2006/05/30 15:53:12 2.104
@@ -16,345 +16,46 @@
# This module is free software; you can redistribute it and/or
# modify it under the same terms as Perl itself.
#
-#----------------------------------------------------------------------------
+# REVISION
+# $Id: Stash.pm,v 2.104 2006/05/30 15:53:12 abw Exp $
#
-# $Id: Stash.pm,v 2.103 2006/05/26 13:45:35 abw Exp $
-#
#============================================================================
package Template::Stash;
-require 5.004;
-
use strict;
+use warnings;
+use Template::VMethods;
-our $VERSION = sprintf("%d.%02d", q$Revision: 2.103 $ =~ /(\d+)\.(\d+)/);
+our $VERSION = 2.90;
our $DEBUG = 0 unless defined $DEBUG;
our $PRIVATE = qr/^[_.]/;
-#========================================================================
-# -- PACKAGE VARIABLES AND SUBS --
-#========================================================================
-
#------------------------------------------------------------------------
-# Definitions of various pseudo-methods. ROOT_OPS are merged into all
-# new Template::Stash objects, and are thus default global functions.
-# SCALAR_OPS are methods that can be called on a scalar, and ditto
-# respectively for LIST_OPS and HASH_OPS
-#------------------------------------------------------------------------
-
-our $ROOT_OPS = {
- 'inc' => sub { local $^W = 0; my $item = shift; ++$item },
- 'dec' => sub { local $^W = 0; my $item = shift; --$item },
-# import => \&hash_import,
- defined $ROOT_OPS ? %$ROOT_OPS : (),
-};
-
-our $SCALAR_OPS = {
- 'item' => sub { $_[0] },
- 'list' => sub { [ $_[0] ] },
- 'hash' => sub { { value => $_[0] } },
- 'length' => sub { length $_[0] },
- 'size' => sub { return 1 },
- 'defined' => sub { return 1 },
- 'match' => sub {
- my ($str, $search, $global) = @_;
- return $str unless defined $str and defined $search;
- my @matches = $global ? ($str =~ /$search/g)
- : ($str =~ /$search/);
- return @matches ? \@matches : '';
- },
- 'search' => sub {
- my ($str, $pattern) = @_;
- return $str unless defined $str and defined $pattern;
- return $str =~ /$pattern/;
- },
- 'repeat' => sub {
- my ($str, $count) = @_;
- $str = '' unless defined $str;
- return '' unless $count;
- $count ||= 1;
- return $str x $count;
- },
- 'replace' => sub {
- my ($text, $pattern, $replace, $global) = @_;
- $text = '' unless defined $text;
- $pattern = '' unless defined $pattern;
- $replace = '' unless defined $replace;
- $global = 1 unless defined $global;
-
- if ($replace =~ /\$\d+/) {
- # replacement string may contain backrefs
- my $expand = sub {
- my ($chunk, $start, $end) = @_;
- $chunk =~ s{ \\(\\|\$) | \$ (\d+) }{
- $1 ? $1
- : ($2 > $#$start || $2 == 0) ? ''
- : substr($text, $start->[$2], $end->[$2] - $start->[$2]);
- }exg;
- $chunk;
- };
- if ($global) {
- $text =~ s{$pattern}{ &$expand($replace, [@-], [@+]) }eg;
- }
- else {
- $text =~ s{$pattern}{ &$expand($replace, [@-], [@+]) }e;
- }
- }
- else {
- if ($global) {
- $text =~ s/$pattern/$replace/g;
- }
- else {
- $text =~ s/$pattern/$replace/;
- }
- }
- return $text;
- },
- 'remove' => sub {
- my ($str, $search) = @_;
- return $str unless defined $str and defined $search;
- $str =~ s/$search//g;
- return $str;
- },
- 'split' => sub {
- my ($str, $split, $limit) = @_;
- $str = '' unless defined $str;
-
- # we have to be very careful about spelling out each possible
- # combination of arguments because split() is very sensitive
- # to them, for example C<split(' ', ...)> behaves differently
- # to C<$space=' '; split($space, ...)>
-
- if (defined $limit) {
- return [ defined $split
- ? split($split, $str, $limit)
- : split(' ', $str, $limit) ];
- }
- else {
- return [ defined $split
- ? split($split, $str)
- : split(' ', $str) ];
- }
- },
- 'chunk' => sub {
- my ($string, $size) = @_;
- my @list;
- $size ||= 1;
- if ($size < 0) {
- # sexeger! It's faster to reverse the string, search
- # it from the front and then reverse the output than to
- # search it from the end, believe it nor not!
- $string = reverse $string;
- $size = -$size;
- unshift(@list, scalar reverse $1)
- while ($string =~ /((.{$size})|(.+))/g);
- }
- else {
- push(@list, $1) while ($string =~ /((.{$size})|(.+))/g);
- }
- return \@list;
- },
- 'substr' => sub {
- my ($text, $offset, $length, $replacement) = @_;
- $offset ||= 0;
-
- if(defined $length) {
- if (defined $replacement) {
- substr( $text, $offset, $length, $replacement );
- return $text;
- }
- else {
- return substr( $text, $offset, $length );
- }
- }
- else {
- return substr( $text, $offset );
- }
- },
+# Virtual Methods
+#
+# If any of $ROOT_OPS, $SCALAR_OPS, $HASH_OPS or $LIST_OPS are already
+# defined then we merge their contents with the default virtual methods
+# define by Template::VMethods. Otherwise we can directly alias the
+# corresponding Template::VMethod package vars.
+#------------------------------------------------------------------------
- defined $SCALAR_OPS ? %$SCALAR_OPS : (),
-};
+our $ROOT_OPS = defined $ROOT_OPS
+ ? { %{$Template::VMethods::ROOT_VMETHODS}, %$ROOT_OPS }
+ : $Template::VMethods::ROOT_VMETHODS;
-our $HASH_OPS = {
- 'item' => sub {
- my ($hash, $item) = @_;
- $item = '' unless defined $item;
- return if $PRIVATE && $item =~ /$PRIVATE/;
- $hash->{ $item };
- },
- 'hash' => sub { $_[0] },
- 'size' => sub { scalar keys %{$_[0]} },
- 'each' => sub { # this will be changed in TT3 to do what pairs does
- [ %{ $_[0] } ] },
- 'keys' => sub { [ keys %{ $_[0] } ] },
- 'values' => sub { [ values %{ $_[0] } ] },
- 'items' => sub { [ %{ $_[0] } ] },
- 'pairs' => sub { [ map { { key => $_ , value => $_[0]->{ $_ } } }
- sort keys %{ $_[0] } ] },
- 'list' => sub {
- my ($hash, $what) = @_;
- $what ||= '';
- return ($what eq 'keys') ? [ keys %$hash ]
- : ($what eq 'values') ? [ values %$hash ]
- : ($what eq 'each') ? [ %$hash ]
- : # for now we do what pairs does but this will be changed
- # in TT3 to return [ $hash ] by default
- [ map { { key => $_ , value => $hash->{ $_ } } }
- sort keys %$hash
- ];
- },
- 'exists' => sub { exists $_[0]->{ $_[1] } },
- 'defined' => sub {
- # return the item requested, or 1 if no argument
- # to indicate that the hash itself is defined
- my $hash = shift;
- return @_ ? defined $hash->{ $_[0] } : 1;
- },
- 'delete' => sub {
- my $hash = shift;
- delete $hash->{ $_ } for @_;
- },
- 'import' => \&hash_import,
- 'sort' => sub {
- my ($hash) = @_;
- [ sort { lc $hash->{$a} cmp lc $hash->{$b} } (keys %$hash) ];
- },
- 'nsort' => sub {
- my ($hash) = @_;
- [ sort { $hash->{$a} <=> $hash->{$b} } (keys %$hash) ];
- },
- defined $HASH_OPS ? %$HASH_OPS : (),
-};
-
-our $LIST_OPS = {
- 'item' => sub { $_[0]->[ $_[1] || 0 ] },
- 'list' => sub { $_[0] },
- 'hash' => sub {
- my $list = shift;
- if (@_) {
- my $n = shift || 0;
- return { map { ($n++, $_) } @$list };
- }
- no warnings;
- return { @$list };
- },
- 'push' => sub { my $list = shift; push(@$list, @_); return '' },
- 'pop' => sub { my $list = shift; pop(@$list) },
- 'unshift' => sub { my $list = shift; unshift(@$list, @_); return '' },
- 'shift' => sub { my $list = shift; shift(@$list) },
- 'max' => sub { local $^W = 0; my $list = shift; $#$list; },
- 'size' => sub { local $^W = 0; my $list = shift; $#$list + 1; },
- 'defined' => sub {
- # return the item requested, or 1 if no argument to
- # indicate that the hash itself is defined
- my $list = shift;
- return @_ ? defined $list->[$_[0]] : 1;
- },
- 'first' => sub {
- my $list = shift;
- return $list->[0] unless @_;
- return [ @$list[0..$_[0]-1] ];
- },
- 'last' => sub {
- my $list = shift;
- return $list->[-1] unless @_;
- return [ @$list[-$_[0]..-1] ];
- },
- 'reverse' => sub { my $list = shift; [ reverse @$list ] },
- 'grep' => sub {
- my ($list, $pattern) = @_;
- $pattern ||= '';
- return [ grep /$pattern/, @$list ];
- },
- 'join' => sub {
- my ($list, $joint) = @_;
- join(defined $joint ? $joint : ' ',
- map { defined $_ ? $_ : '' } @$list)
- },
- 'sort' => sub {
- $^W = 0;
- my ($list, $field) = @_;
- return $list unless @$list > 1; # no need to sort 1 item lists
- return [
- $field # Schwartzian Transform
- ? map { $_->[0] } # for case insensitivity
- sort { $a->[1] cmp $b->[1] }
- map { [ $_, lc(ref($_) eq 'HASH'
- ? $_->{ $field } :
- UNIVERSAL::can($_, $field)
- ? $_->$field() : $_) ] }
- @$list
- : map { $_->[0] }
- sort { $a->[1] cmp $b->[1] }
- map { [ $_, lc $_ ] }
- @$list,
- ];
- },
- 'nsort' => sub {
- my ($list, $field) = @_;
- return $list unless @$list > 1; # no need to sort 1 item lists
- return [
- $field # Schwartzian Transform
- ? map { $_->[0] } # for case insensitivity
- sort { $a->[1] <=> $b->[1] }
- map { [ $_, lc(ref($_) eq 'HASH'
- ? $_->{ $field } :
- UNIVERSAL::can($_, $field)
- ? $_->$field() : $_) ] }
- @$list
- : map { $_->[0] }
- sort { $a->[1] <=> $b->[1] }
- map { [ $_, lc $_ ] }
- @$list,
- ];
- },
- 'unique' => sub { my %u; [ grep { ++$u{$_} == 1 } @{$_[0]} ] },
- 'import' => sub {
- my $list = shift;
- push(@$list, grep defined, map ref eq 'ARRAY' ? @$_ : undef, @_);
- return $list;
- },
- 'merge' => sub {
- my $list = shift;
- return [ @$list, grep defined, map ref eq 'ARRAY' ? @$_ : undef, @_ ];
- },
- 'slice' => sub {
- my ($list, $from, $to) = @_;
- $from ||= 0;
- $to = $#$list unless defined $to;
- return [ @$list[$from..$to] ];
- },
- 'splice' => sub {
- my ($list, $offset, $length, @replace) = @_;
- if (@replace) {
- # @replace can contain a list of multiple replace items, or
- # be a single reference to a list
- @replace = @{ $replace[0] }
- if @replace == 1 && ref $replace[0] eq 'ARRAY';
- return [ splice @$list, $offset, $length, @replace ];
- }
- elsif (defined $length) {
- return [ splice @$list, $offset, $length ];
- }
- elsif (defined $offset) {
- return [ splice @$list, $offset ];
- }
- else {
- return [ splice(@$list) ];
- }
- },
+our $SCALAR_OPS = defined $SCALAR_OPS
+ ? { %{$Template::VMethods::TEXT_VMETHODS}, %$SCALAR_OPS }
+ : $Template::VMethods::TEXT_VMETHODS;
- defined $LIST_OPS ? %$LIST_OPS : (),
-};
+our $HASH_OPS = defined $HASH_OPS
+ ? { %{$Template::VMethods::HASH_VMETHODS}, %$HASH_OPS }
+ : $Template::VMethods::HASH_VMETHODS;
-sub hash_import {
- my ($hash, $imp) = @_;
- $imp = {} unless ref $imp eq 'HASH';
- @$hash{ keys %$imp } = values %$imp;
- return '';
-}
+our $LIST_OPS = defined $LIST_OPS
+ ? { %{$Template::VMethods::LIST_VMETHODS}, %$LIST_OPS }
+ : $Template::VMethods::LIST_VMETHODS;
#------------------------------------------------------------------------
@@ -460,7 +161,7 @@
}, ref $self;
# perform hash import if defined
- &{ $HASH_OPS->{ import }}($clone, $import)
+ &{ $HASH_OPS->{ import } }($clone, $import)
if defined $import;
return $clone;
@@ -1093,8 +794,8 @@
=head1 VERSION
-2.102, distributed as part of the
-Template Toolkit version 2.15, released on 26 May 2006.
+2.9, distributed as part of the
+Template Toolkit version 2.15b, released on 30 May 2006.
=head1 COPYRIGHT
2.74 +4 -4 Template2/lib/Template/Test.pm
Index: Test.pm
===================================================================
RCS file: /template-toolkit/Template2/lib/Template/Test.pm,v
retrieving revision 2.73
retrieving revision 2.74
diff -u -r2.73 -r2.74
--- Test.pm 2006/05/26 13:45:35 2.73
+++ Test.pm 2006/05/30 15:53:12 2.74
@@ -20,7 +20,7 @@
#
#----------------------------------------------------------------------------
#
-# $Id: Test.pm,v 2.73 2006/05/26 13:45:35 abw Exp $
+# $Id: Test.pm,v 2.74 2006/05/30 15:53:12 abw Exp $
#
#============================================================================
@@ -35,7 +35,7 @@
use Template qw( :template );
use Exporter;
-$VERSION = sprintf("%d.%02d", q$Revision: 2.73 $ =~ /(\d+)\.(\d+)/);
+$VERSION = sprintf("%d.%02d", q$Revision: 2.74 $ =~ /(\d+)\.(\d+)/);
$DEBUG = 0;
@ISA = qw( Exporter );
@EXPORT = qw( ntests ok is match flush skip_all test_expect callsign banner );
@@ -685,8 +685,8 @@
=head1 VERSION
-2.72, distributed as part of the
-Template Toolkit version 2.15, released on 26 May 2006.
+2.73, distributed as part of the
+Template Toolkit version 2.15b, released on 30 May 2006.
=head1 COPYRIGHT
2.53 +1 -1 Template2/lib/Template/Tutorial.pod
Index: Tutorial.pod
===================================================================
RCS file: /template-toolkit/Template2/lib/Template/Tutorial.pod,v
retrieving revision 2.52
retrieving revision 2.53
diff -u -r2.52 -r2.53
--- Tutorial.pod 2006/05/26 13:45:35 2.52
+++ Tutorial.pod 2006/05/30 15:53:12 2.53
@@ -86,7 +86,7 @@
=head1 VERSION
-Template Toolkit version 2.15, released on 26 May 2006.
+Template Toolkit version 2.15b, released on 30 May 2006.
=head1 COPYRIGHT