r47353 - in /trunk/libtext-micromason-perl: META.yml Makefile.PL MicroMason.pm MicroMason/Base.pm MicroMason/Docs/Changes.pod MicroMason/Docs/ReadMe.pod MicroMason/Docs/ToDo.pod debian/changelog t/08-errors.t t/09-regression.t
jawnsy-guest at users.alioth.debian.org
jawnsy-guest at users.alioth.debian.org
Tue Nov 17 05:31:53 UTC 2009
Author: jawnsy-guest
Date: Tue Nov 17 05:31:47 2009
New Revision: 47353
URL: http://svn.debian.org/wsvn/pkg-perl/?sc=1&rev=47353
Log:
New upstream release
Modified:
trunk/libtext-micromason-perl/META.yml
trunk/libtext-micromason-perl/Makefile.PL
trunk/libtext-micromason-perl/MicroMason.pm
trunk/libtext-micromason-perl/MicroMason/Base.pm
trunk/libtext-micromason-perl/MicroMason/Docs/Changes.pod
trunk/libtext-micromason-perl/MicroMason/Docs/ReadMe.pod
trunk/libtext-micromason-perl/MicroMason/Docs/ToDo.pod
trunk/libtext-micromason-perl/debian/changelog
trunk/libtext-micromason-perl/t/08-errors.t
trunk/libtext-micromason-perl/t/09-regression.t
Modified: trunk/libtext-micromason-perl/META.yml
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libtext-micromason-perl/META.yml?rev=47353&op=diff
==============================================================================
--- trunk/libtext-micromason-perl/META.yml (original)
+++ trunk/libtext-micromason-perl/META.yml Tue Nov 17 05:31:47 2009
@@ -1,6 +1,6 @@
--- #YAML:1.0
name: Text-MicroMason
-version: 2.06
+version: 2.07
abstract: Simple and Extensible Templating
author:
- Alan Ferrency <ferrency at cpan.org>
@@ -14,6 +14,7 @@
Class::MixinFactory: 0.9
Cwd: 2.21
File::Spec: 0.9
+ Test::More: 0.48
no_index:
directory:
- t
Modified: trunk/libtext-micromason-perl/Makefile.PL
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libtext-micromason-perl/Makefile.PL?rev=47353&op=diff
==============================================================================
--- trunk/libtext-micromason-perl/Makefile.PL (original)
+++ trunk/libtext-micromason-perl/Makefile.PL Tue Nov 17 05:31:47 2009
@@ -1,4 +1,4 @@
-# $Id: Makefile.PL,v 1.6 2009/11/11 16:23:36 alan Exp $
+# $Id: Makefile.PL,v 1.7 2009/11/16 21:36:24 alan Exp $
use ExtUtils::MakeMaker;
@@ -11,6 +11,7 @@
'Class::MixinFactory' => 0.9,
'File::Spec' => 0.9,
'Cwd' => 2.21,
+ 'Test::More' => 0.48,
},
ABSTRACT_FROM => 'MicroMason.pm',
Modified: trunk/libtext-micromason-perl/MicroMason.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libtext-micromason-perl/MicroMason.pm?rev=47353&op=diff
==============================================================================
--- trunk/libtext-micromason-perl/MicroMason.pm (original)
+++ trunk/libtext-micromason-perl/MicroMason.pm Tue Nov 17 05:31:47 2009
@@ -1,5 +1,5 @@
package Text::MicroMason;
-$VERSION = '2.06';
+$VERSION = '2.07';
# The #line directive requires Perl 5.6 to work correctly the way we use
# it in Base.
@@ -122,12 +122,11 @@
Any attributes provided to compile() will temporarily override the
persistant options defined by new(), for that template only.
-You can provide the template as a text string, as an array of text
-lines, or as a file name or handle:
+You can provide the template as a text string, a file name, or an open
+file handle:
$code_ref = $mason->compile( text => $template );
$code_ref = $mason->compile( text => \$template );
- $code_ref = $mason->compile( lines => \@template );
$code_ref = $mason->compile( file => $filename );
$code_ref = $mason->compile( handle => $fh );
$code_ref = $mason->compile( handle => \*FILE );
Modified: trunk/libtext-micromason-perl/MicroMason/Base.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libtext-micromason-perl/MicroMason/Base.pm?rev=47353&op=diff
==============================================================================
--- trunk/libtext-micromason-perl/MicroMason/Base.pm (original)
+++ trunk/libtext-micromason-perl/MicroMason/Base.pm Tue Nov 17 05:31:47 2009
@@ -59,7 +59,6 @@
######################################################################
# $code_ref = $mason->compile( text => $template, %options );
-# $code_ref = $mason->compile( lines => \@template, %options );
# $code_ref = $mason->compile( file => $filename, %options );
# $code_ref = $mason->compile( handle => $filehandle, %options );
sub compile {
@@ -263,7 +262,6 @@
my ( $order, $fragments, $token_map ) = $self->assembler_vars();
my %token_streams = map { $_ => [] } map { ( /^\W?\@(\w+)$/ ) } @$order;
- my ($output) = $fragments->{add_output};
while ( scalar @tokens ) {
my ( $type, $token ) = splice( @tokens, 0, 2 );
@@ -274,11 +272,18 @@
or $self->croak_msg( "Unexpected token type '$type': '$token'" );
($type, $token) = &$sub( $self, $token );
}
-
+
if ( my $typedef = $token_map->{ $type } ) {
- $typedef =~ s{\bTOKEN\b}{$token}g;
- $typedef =~ s{\bQUOTED\b}{qq(\Q$token\E)}g;
- $typedef =~ s{\bOUT\b}{$output}g;
+ # Perform token map substitution in a single pass so that uses of
+ # OUT in the token text are not improperly converted to output calls.
+ # -- Simon, 2009-11-14
+ my %substitution_map = (
+ 'OUT' => $fragments->{add_output},
+ 'TOKEN' => $token,
+ 'QUOTED' => "qq(\Q$token\E)",
+ );
+ $typedef =~ s/\b(OUT|TOKEN|QUOTED)\b/$substitution_map{$1}/g;
+
( $type, $token ) = split ' ', $typedef, 2;
}
Modified: trunk/libtext-micromason-perl/MicroMason/Docs/Changes.pod
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libtext-micromason-perl/MicroMason/Docs/Changes.pod?rev=47353&op=diff
==============================================================================
--- trunk/libtext-micromason-perl/MicroMason/Docs/Changes.pod (original)
+++ trunk/libtext-micromason-perl/MicroMason/Docs/Changes.pod Tue Nov 17 05:31:47 2009
@@ -4,6 +4,29 @@
=head1 VERSION 2 HISTORY
+
+=head2 Version 2.07
+
+=over 4
+
+=item 2009-11-16
+
+Merge patch from Simon Cavalletto: fix bug reported in CPAN forum with
+"OUT" appearing in the input template stream. Thanks!
+
+Update requirement for Test::More 0.48 or later in Makefile.PL. Tests
+using unlike() failed with Test::More version 0.47.
+
+Fix problem in t/08_errors.t which caused test failures in Perl 5.6. The
+error message isn't as important as the test made it out to be, but the
+code didn't have a problem.
+
+=item 2009-11-12
+
+Remove documentation for unsupported compile(lines => ...) mode. Put it
+on ToDo instead.
+
+=back
=head2 Version 2.06
Modified: trunk/libtext-micromason-perl/MicroMason/Docs/ReadMe.pod
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libtext-micromason-perl/MicroMason/Docs/ReadMe.pod?rev=47353&op=diff
==============================================================================
--- trunk/libtext-micromason-perl/MicroMason/Docs/ReadMe.pod (original)
+++ trunk/libtext-micromason-perl/MicroMason/Docs/ReadMe.pod Tue Nov 17 05:31:47 2009
@@ -50,7 +50,7 @@
=head1 DISTRIBUTION STATUS
-This is version 2.06 of Text::MicroMason.
+This is version 2.07 of Text::MicroMason.
This module has been available on CPAN for over six years.
Modified: trunk/libtext-micromason-perl/MicroMason/Docs/ToDo.pod
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libtext-micromason-perl/MicroMason/Docs/ToDo.pod?rev=47353&op=diff
==============================================================================
--- trunk/libtext-micromason-perl/MicroMason/Docs/ToDo.pod (original)
+++ trunk/libtext-micromason-perl/MicroMason/Docs/ToDo.pod Tue Nov 17 05:31:47 2009
@@ -41,6 +41,18 @@
AutoLoad mixin. Using this mixin adds an AUTOLOADER to the mason object,
which interprets all unknown method calls as template names.
+
+=back
+
+=head2 New Features
+
+=over 4
+
+=item *
+
+Support the previously supported but now unsupported
+compile(lines => ...) source type. This was documented but non-
+functional, and so the pod was removed.
=back
Modified: trunk/libtext-micromason-perl/debian/changelog
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libtext-micromason-perl/debian/changelog?rev=47353&op=diff
==============================================================================
--- trunk/libtext-micromason-perl/debian/changelog (original)
+++ trunk/libtext-micromason-perl/debian/changelog Tue Nov 17 05:31:47 2009
@@ -1,3 +1,9 @@
+libtext-micromason-perl (2.07-1) UNRELEASED; urgency=low
+
+ * New upstream release
+
+ -- Jonathan Yu <jawnsy at cpan.org> Mon, 16 Nov 2009 21:05:52 -0500
+
libtext-micromason-perl (2.06-1) unstable; urgency=low
[ Jonathan Yu ]
Modified: trunk/libtext-micromason-perl/t/08-errors.t
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libtext-micromason-perl/t/08-errors.t?rev=47353&op=diff
==============================================================================
--- trunk/libtext-micromason-perl/t/08-errors.t (original)
+++ trunk/libtext-micromason-perl/t/08-errors.t Tue Nov 17 05:31:47 2009
@@ -1,7 +1,7 @@
#!/usr/bin/perl -w
use strict;
-use Test::More tests => 29;
+use Test::More tests => 28;
use Text::MicroMason;
my $m = Text::MicroMason->new( );
@@ -46,10 +46,10 @@
like pop @lines, qr{\s+eval \{\.\.\.\} called at t/08-errors.t line \d+}, 'last line of $@ has line number too'
or diag $@;
- like pop @lines, qr{\s+at t/08-errors.t line \d+}, 'second to last line of $@ has line number too'
- or diag $@;
- like pop @lines, qr{\Q** Please use Text::MicroMason->new(-LineNumbers) for better diagnostics!}
- or diag $@;
+ # Perl 5.6 has one line of "at line number" junk, but perl 5.8 has
+ # two lines. The next line is our diagnostics message.
+ ok ((pop @lines) =~ m{\Q** Please use Text::MicroMason->new(-LineNumbers) for better diagnostics!}
+ or (pop @lines) =~ m{\Q** Please use Text::MicroMason->new(-LineNumbers) for better diagnostics!});
my $n = 0;
foreach my $line (@lines) {
Modified: trunk/libtext-micromason-perl/t/09-regression.t
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libtext-micromason-perl/t/09-regression.t?rev=47353&op=diff
==============================================================================
--- trunk/libtext-micromason-perl/t/09-regression.t (original)
+++ trunk/libtext-micromason-perl/t/09-regression.t Tue Nov 17 05:31:47 2009
@@ -1,7 +1,7 @@
#!/usr/bin/perl -w
use strict;
-use Test::More tests => 24;
+use Test::More tests => 25;
use_ok 'Text::MicroMason';
@@ -177,3 +177,11 @@
}
######################################################################
+
+TEXT_CONTAINS_OUT: {
+ my $scr_inout = 'IN <% "and" %> OUT burger';
+ my $res_inout = 'IN and OUT burger';
+ is $m->execute( text => $scr_inout), $res_inout;
+}
+
+######################################################################
More information about the Pkg-perl-cvs-commits
mailing list