[MKDoc-commit] [Petal] fix ${1} regression introduced in 2.16, release 2.18

bruno at mkdoc.demon.co.uk bruno at mkdoc.demon.co.uk
Tue Jan 17 13:07:31 GMT 2006


Log Message:
-----------
[Petal] fix ${1} regression introduced in 2.16, release 2.18

Modified Files:
--------------
    Petal:
        Changes
        MANIFEST
        META.yml
    Petal/lib:
        Petal.pm
    Petal/lib/Petal/Hash:
        String.pm
    Petal/t:
        087_dollar_one.t
    Petal/t/data:
        dollar-one.xml

Added Files:
-----------
    Petal/t:
        093_translate.t
    Petal/t/data:
        translate.xml

-------------- next part --------------
Index: MANIFEST
===================================================================
RCS file: /var/spool/cvs/Petal/MANIFEST,v
retrieving revision 1.52
retrieving revision 1.53
diff -LMANIFEST -LMANIFEST -u -r1.52 -r1.53
--- MANIFEST
+++ MANIFEST
@@ -97,6 +97,7 @@
 t/090_dollarone-again.t
 t/091_attribute-newline.t
 t/092_on-error.t
+t/093_translate.t
 t/benchmark.pl
 t/data/access_obj_array.html
 t/data/access_obj_hash.html
@@ -206,6 +207,7 @@
 t/data/test_ns_attributes/test_ns_attributes7.xml
 t/data/test_ns_attributes/test_rightWayOfDoing.xml
 t/data/tests_with_zero.xml
+t/data/translate.xml
 t/data/utf-8.xml
 t/data/xhtml.html
 t/data/xhtml_omit_tag.html
Index: META.yml
===================================================================
RCS file: /var/spool/cvs/Petal/META.yml,v
retrieving revision 1.10
retrieving revision 1.11
diff -LMETA.yml -LMETA.yml -u -r1.10 -r1.11
--- META.yml
+++ META.yml
@@ -1,7 +1,7 @@
 # http://module-build.sourceforge.net/META-spec.html
 #XXXXXXX This is a prototype!!!  It will change in the future!!! XXXXX#
 name:         Petal
-version:      2.17
+version:      2.18
 version_from: lib/Petal.pm
 installdirs:  site
 requires:
Index: Changes
===================================================================
RCS file: /var/spool/cvs/Petal/Changes,v
retrieving revision 1.142
retrieving revision 1.143
diff -LChanges -LChanges -u -r1.142 -r1.143
--- Changes
+++ Changes
@@ -1,11 +1,12 @@
 Revision history for Petal.
 
-2.18
+2.18 Tue Jan 17 13:01:00 2006
     - $Petal::CodeGenerator::PI_RE should be applied newline insensitively
     - pod fixes
     - Cookbook tal:repeat example (DSL)
     - pod note that on-error isn't fully implemented
     - defang html metacharacters in on-error output
+    - undo 2.16 $Petal::Hash::String::VARIABLE_RE_BRACKETS ${1} regression
 
 2.17 Wed Sep  7 15:30:00 2005
     - test 041 check that   becomes chr(160) not chr(194) (William McKee)
Index: String.pm
===================================================================
RCS file: /var/spool/cvs/Petal/lib/Petal/Hash/String.pm,v
retrieving revision 1.11
retrieving revision 1.12
diff -Llib/Petal/Hash/String.pm -Llib/Petal/Hash/String.pm -u -r1.11 -r1.12
--- lib/Petal/Hash/String.pm
+++ lib/Petal/Hash/String.pm
@@ -12,7 +12,7 @@
 
 
 our $VARIABLE_RE_SIMPLE   = qq |\\\$[A-Za-z_][A-Za-z0-9_\\.:\/]+|;
-our $VARIABLE_RE_BRACKETS = qq |\\\$(?<!\\\\)\\{[^0-9].*?(?<!\\\\)\\}|;
+our $VARIABLE_RE_BRACKETS = qq |\\\$(?<!\\\\)\\{.*?(?<!\\\\)\\}|;
 our $TOKEN_RE             = "(?:$VARIABLE_RE_SIMPLE|$VARIABLE_RE_BRACKETS)";
 
 
Index: 087_dollar_one.t
===================================================================
RCS file: /var/spool/cvs/Petal/t/087_dollar_one.t,v
retrieving revision 1.1
retrieving revision 1.2
diff -Lt/087_dollar_one.t -Lt/087_dollar_one.t -u -r1.1 -r1.2
--- t/087_dollar_one.t
+++ t/087_dollar_one.t
@@ -20,8 +20,3 @@
 
 like ($string, qr|<f>\$@</f>|);
 like ($string, qr|<g>\$1</g>|);
-like ($string, qr|<h>\$\{1\}</h>|);
-
-like ($string, qr|<i>\$\{1 bar\}</i>|);
-like ($string, qr|<j>\$\{1bar\}</j>|);
-like ($string, qr|<k>\$\{1_bar\}</k>|);
--- /dev/null
+++ t/093_translate.t
@@ -0,0 +1,19 @@
+#!/usr/bin/perl
+use warnings;
+use strict;
+use lib ('lib');
+use Test::More 'no_plan';
+use Petal;
+
+$Petal::BASE_DIR = './t/data/';
+$Petal::DISK_CACHE = 0;
+$Petal::MEMORY_CACHE = 0;
+$Petal::TAINT = 1;
+
+my $template = new Petal (file => 'translate.xml');
+my $string   = $template->process;
+my $res = Petal::I18N->process ($string);
+
+unlike ($res, '/\$\{1\}/');
+unlike ($res, '/\$\{2\}/');
+like ($res, '/download\.gna\.org/');
Index: Petal.pm
===================================================================
RCS file: /var/spool/cvs/Petal/lib/Petal.pm,v
retrieving revision 1.138
retrieving revision 1.139
diff -Llib/Petal.pm -Llib/Petal.pm -u -r1.138 -r1.139
--- lib/Petal.pm
+++ lib/Petal.pm
@@ -101,7 +101,7 @@
 
 
 # this is for CPAN
-our $VERSION = '2.17';
+our $VERSION = '2.18';
 
 
 # The CodeGenerator class backend to use.
--- /dev/null
+++ t/data/translate.xml
@@ -0,0 +1,7 @@
+<?xml version="1.0"?>
+<html xmlns:i18n="http://xml.zope.org/namespaces/i18n" i18n:domain="testdomain">
+<span i18n:translate="">Fedora Core 4 RPMs added (<a 
+href="http://download.gna.org/kvpnc/kvpnc-0.8.2.1-1.fc4.i386.rpm">RPM</a>, <a 
+href="http://download.gna.org/kvpnc/kvpnc-debuginfo-0.8.2.1-1.fc4.i386.rpm">Debug 
+RPM</a>).</span>
+</html>
Index: dollar-one.xml
===================================================================
RCS file: /var/spool/cvs/Petal/t/data/dollar-one.xml,v
retrieving revision 1.1
retrieving revision 1.2
diff -Lt/data/dollar-one.xml -Lt/data/dollar-one.xml -u -r1.1 -r1.2
--- t/data/dollar-one.xml
+++ t/data/dollar-one.xml
@@ -6,9 +6,5 @@
 <e>${foo}</e>
 <f>$@</f>
 <g>$1</g>
-<h>${1}</h>
-<i>${1 bar}</i>
-<j>${1bar}</j>
-<k>${1_bar}</k>
 </body>
 


More information about the MKDoc-commit mailing list