r59368 - in /branches/upstream/libstring-formatter-perl/current: Changes MANIFEST META.json META.yml Makefile.PL README lib/String/Formatter.pm lib/String/Formatter/Cookbook.pm t/release-pod-coverage.t t/release-pod-syntax.t t/stringf.t

ansgar-guest at users.alioth.debian.org ansgar-guest at users.alioth.debian.org
Mon Jun 14 02:35:32 UTC 2010


Author: ansgar-guest
Date: Mon Jun 14 02:35:27 2010
New Revision: 59368

URL: http://svn.debian.org/wsvn/pkg-perl/?sc=1&rev=59368
Log:
[svn-upgrade] new version libstring-formatter-perl (0.101620)

Removed:
    branches/upstream/libstring-formatter-perl/current/t/release-pod-coverage.t
Modified:
    branches/upstream/libstring-formatter-perl/current/Changes
    branches/upstream/libstring-formatter-perl/current/MANIFEST
    branches/upstream/libstring-formatter-perl/current/META.json
    branches/upstream/libstring-formatter-perl/current/META.yml
    branches/upstream/libstring-formatter-perl/current/Makefile.PL
    branches/upstream/libstring-formatter-perl/current/README
    branches/upstream/libstring-formatter-perl/current/lib/String/Formatter.pm
    branches/upstream/libstring-formatter-perl/current/lib/String/Formatter/Cookbook.pm
    branches/upstream/libstring-formatter-perl/current/t/release-pod-syntax.t
    branches/upstream/libstring-formatter-perl/current/t/stringf.t

Modified: branches/upstream/libstring-formatter-perl/current/Changes
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libstring-formatter-perl/current/Changes?rev=59368&op=diff
==============================================================================
--- branches/upstream/libstring-formatter-perl/current/Changes (original)
+++ branches/upstream/libstring-formatter-perl/current/Changes Mon Jun 14 02:35:27 2010
@@ -1,4 +1,7 @@
 Revision history for String-Formatter
+
+0.101620  2010-06-11 21:31:26 America/New_York
+          add indexed_replace, require_arrayref_input, and indexed_stringf
 
 0.100720  2010-03-13 09:36:03 America/New_York
           fix an ancillary file that brought in a bunch of bogus prereqs

Modified: branches/upstream/libstring-formatter-perl/current/MANIFEST
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libstring-formatter-perl/current/MANIFEST?rev=59368&op=diff
==============================================================================
--- branches/upstream/libstring-formatter-perl/current/MANIFEST (original)
+++ branches/upstream/libstring-formatter-perl/current/MANIFEST Mon Jun 14 02:35:27 2010
@@ -14,6 +14,5 @@
 t/braces.t
 t/method.t
 t/params.t
-t/release-pod-coverage.t
 t/release-pod-syntax.t
-t/stringf.t
+t/stringf.t

Modified: branches/upstream/libstring-formatter-perl/current/META.json
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libstring-formatter-perl/current/META.json?rev=59368&op=diff
==============================================================================
--- branches/upstream/libstring-formatter-perl/current/META.json (original)
+++ branches/upstream/libstring-formatter-perl/current/META.json Mon Jun 14 02:35:27 2010
@@ -1,29 +1,222 @@
 {
-   "resources" : {
-      "repository" : "git://git.codesimply.com/String-Formatter.git"
-   },
-   "meta-spec" : {
-      "version" : 1.4,
-      "url" : "http://module-build.sourceforge.net/META-spec-v1.4.html"
-   },
-   "generated_by" : "Dist::Zilla version 1.100710",
-   "version" : "0.100720",
-   "name" : "String-Formatter",
+   "abstract" : "build sprintf-like functions of your own",
    "author" : [
       "Ricardo Signes <rjbs at cpan.org>",
       "Darren Chamberlain <darren at cpan.org>"
    ],
-   "license" : "gpl",
-   "build_requires" : {},
-   "requires" : {
-      "perl" : "5.006",
-      "Test::More" : "0",
-      "Params::Util" : "0",
-      "Sub::Exporter" : "0"
+   "dynamic_config" : 0,
+   "generated_by" : "Dist::Zilla version 4.101620, CPAN::Meta::Converter version 2.101600",
+   "license" : [
+      "gpl_2"
+   ],
+   "meta-spec" : {
+      "url" : "http://search.cpan.org/perldoc?CPAN::Meta::Spec",
+      "version" : "2"
    },
-   "abstract" : "build sprintf-like functions of your own",
-   "configure_requires" : {
-      "ExtUtils::MakeMaker" : "6.11"
+   "name" : "String-Formatter",
+   "prereqs" : {
+      "configure" : {
+         "requires" : {
+            "ExtUtils::MakeMaker" : "6.31"
+         }
+      },
+      "runtime" : {
+         "requires" : {
+            "Params::Util" : 0,
+            "Sub::Exporter" : 0,
+            "perl" : "5.006"
+         }
+      },
+      "test" : {
+         "requires" : {
+            "Test::More" : 0
+         }
+      }
+   },
+   "release_status" : "stable",
+   "resources" : {
+      "repository" : {
+         "type" : "git",
+         "url" : "git://git.codesimply.com/String-Formatter.git"
+      }
+   },
+   "version" : "0.101620",
+   "x_Dist_Zilla" : {
+      "plugins" : [
+         {
+            "class" : "Dist::Zilla::Plugin::Prereq",
+            "config" : {
+               "Dist::Zilla::Plugin::Prereq" : {
+                  "phase" : "runtime",
+                  "type" : "requires"
+               }
+            },
+            "name" : "Prereq",
+            "version" : "4.101620"
+         },
+         {
+            "class" : "Dist::Zilla::Plugin::GatherDir",
+            "name" : "@RJBS/@Basic/GatherDir",
+            "version" : "4.101620"
+         },
+         {
+            "class" : "Dist::Zilla::Plugin::PruneCruft",
+            "name" : "@RJBS/@Basic/PruneCruft",
+            "version" : "4.101620"
+         },
+         {
+            "class" : "Dist::Zilla::Plugin::ManifestSkip",
+            "name" : "@RJBS/@Basic/ManifestSkip",
+            "version" : "4.101620"
+         },
+         {
+            "class" : "Dist::Zilla::Plugin::MetaYAML",
+            "name" : "@RJBS/@Basic/MetaYAML",
+            "version" : "4.101620"
+         },
+         {
+            "class" : "Dist::Zilla::Plugin::License",
+            "name" : "@RJBS/@Basic/License",
+            "version" : "4.101620"
+         },
+         {
+            "class" : "Dist::Zilla::Plugin::Readme",
+            "name" : "@RJBS/@Basic/Readme",
+            "version" : "4.101620"
+         },
+         {
+            "class" : "Dist::Zilla::Plugin::ExtraTests",
+            "name" : "@RJBS/@Basic/ExtraTests",
+            "version" : "4.101620"
+         },
+         {
+            "class" : "Dist::Zilla::Plugin::ExecDir",
+            "name" : "@RJBS/@Basic/ExecDir",
+            "version" : "4.101620"
+         },
+         {
+            "class" : "Dist::Zilla::Plugin::ShareDir",
+            "name" : "@RJBS/@Basic/ShareDir",
+            "version" : "4.101620"
+         },
+         {
+            "class" : "Dist::Zilla::Plugin::MakeMaker",
+            "name" : "@RJBS/@Basic/MakeMaker",
+            "version" : "4.101620"
+         },
+         {
+            "class" : "Dist::Zilla::Plugin::Manifest",
+            "name" : "@RJBS/@Basic/Manifest",
+            "version" : "4.101620"
+         },
+         {
+            "class" : "Dist::Zilla::Plugin::TestRelease",
+            "name" : "@RJBS/@Basic/TestRelease",
+            "version" : "4.101620"
+         },
+         {
+            "class" : "Dist::Zilla::Plugin::ConfirmRelease",
+            "name" : "@RJBS/@Basic/ConfirmRelease",
+            "version" : "4.101620"
+         },
+         {
+            "class" : "Dist::Zilla::Plugin::UploadToCPAN",
+            "name" : "@RJBS/@Basic/UploadToCPAN",
+            "version" : "4.101620"
+         },
+         {
+            "class" : "Dist::Zilla::Plugin::AutoPrereq",
+            "name" : "@RJBS/AutoPrereq",
+            "version" : "4.101620"
+         },
+         {
+            "class" : "Dist::Zilla::Plugin::AutoVersion",
+            "name" : "@RJBS/AutoVersion",
+            "version" : "4.101620"
+         },
+         {
+            "class" : "Dist::Zilla::Plugin::PkgVersion",
+            "name" : "@RJBS/PkgVersion",
+            "version" : "4.101620"
+         },
+         {
+            "class" : "Dist::Zilla::Plugin::MetaConfig",
+            "name" : "@RJBS/MetaConfig",
+            "version" : "4.101620"
+         },
+         {
+            "class" : "Dist::Zilla::Plugin::MetaJSON",
+            "name" : "@RJBS/MetaJSON",
+            "version" : "4.101620"
+         },
+         {
+            "class" : "Dist::Zilla::Plugin::NextRelease",
+            "name" : "@RJBS/NextRelease",
+            "version" : "4.101620"
+         },
+         {
+            "class" : "Dist::Zilla::Plugin::PodSyntaxTests",
+            "name" : "@RJBS/PodSyntaxTests",
+            "version" : "4.101620"
+         },
+         {
+            "class" : "Dist::Zilla::Plugin::Repository",
+            "name" : "@RJBS/Repository",
+            "version" : "0.13"
+         },
+         {
+            "class" : "Dist::Zilla::Plugin::PodWeaver",
+            "name" : "@RJBS/PodWeaver",
+            "version" : "3.101620"
+         },
+         {
+            "class" : "Dist::Zilla::Plugin::Git::Check",
+            "name" : "@RJBS/@Git/Check",
+            "version" : "1.101330"
+         },
+         {
+            "class" : "Dist::Zilla::Plugin::Git::Commit",
+            "name" : "@RJBS/@Git/Commit",
+            "version" : "1.101330"
+         },
+         {
+            "class" : "Dist::Zilla::Plugin::Git::Tag",
+            "name" : "@RJBS/@Git/Tag",
+            "version" : "1.101330"
+         },
+         {
+            "class" : "Dist::Zilla::Plugin::Git::Push",
+            "name" : "@RJBS/@Git/Push",
+            "version" : "1.101330"
+         },
+         {
+            "class" : "Dist::Zilla::Plugin::FinderCode",
+            "name" : ":InstallModules",
+            "version" : "4.101620"
+         },
+         {
+            "class" : "Dist::Zilla::Plugin::FinderCode",
+            "name" : ":TestFiles",
+            "version" : "4.101620"
+         },
+         {
+            "class" : "Dist::Zilla::Plugin::FinderCode",
+            "name" : ":ExecFiles",
+            "version" : "4.101620"
+         },
+         {
+            "class" : "Dist::Zilla::Plugin::FinderCode",
+            "name" : ":ShareFiles",
+            "version" : "4.101620"
+         }
+      ],
+      "zilla" : {
+         "class" : "Dist::Zilla",
+         "config" : {
+            "is_trial" : 0
+         },
+         "version" : "4.101620"
+      }
    }
 }
 

Modified: branches/upstream/libstring-formatter-perl/current/META.yml
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libstring-formatter-perl/current/META.yml?rev=59368&op=diff
==============================================================================
--- branches/upstream/libstring-formatter-perl/current/META.yml (original)
+++ branches/upstream/libstring-formatter-perl/current/META.yml Mon Jun 14 02:35:27 2010
@@ -3,10 +3,12 @@
 author:
   - 'Ricardo Signes <rjbs at cpan.org>'
   - 'Darren Chamberlain <darren at cpan.org>'
-build_requires: {}
+build_requires:
+  Test::More: 0
 configure_requires:
-  ExtUtils::MakeMaker: 6.11
-generated_by: 'Dist::Zilla version 1.100710'
+  ExtUtils::MakeMaker: 6.31
+dynamic_config: 0
+generated_by: 'Dist::Zilla version 4.101620, CPAN::Meta::Converter version 2.101600'
 license: gpl
 meta-spec:
   url: http://module-build.sourceforge.net/META-spec-v1.4.html
@@ -15,8 +17,146 @@
 requires:
   Params::Util: 0
   Sub::Exporter: 0
-  Test::More: 0
   perl: 5.006
 resources:
   repository: git://git.codesimply.com/String-Formatter.git
-version: 0.100720
+version: 0.101620
+x_Dist_Zilla:
+  plugins:
+    -
+      class: Dist::Zilla::Plugin::Prereq
+      config:
+        Dist::Zilla::Plugin::Prereq:
+          phase: runtime
+          type: requires
+      name: Prereq
+      version: 4.101620
+    -
+      class: Dist::Zilla::Plugin::GatherDir
+      name: '@RJBS/@Basic/GatherDir'
+      version: 4.101620
+    -
+      class: Dist::Zilla::Plugin::PruneCruft
+      name: '@RJBS/@Basic/PruneCruft'
+      version: 4.101620
+    -
+      class: Dist::Zilla::Plugin::ManifestSkip
+      name: '@RJBS/@Basic/ManifestSkip'
+      version: 4.101620
+    -
+      class: Dist::Zilla::Plugin::MetaYAML
+      name: '@RJBS/@Basic/MetaYAML'
+      version: 4.101620
+    -
+      class: Dist::Zilla::Plugin::License
+      name: '@RJBS/@Basic/License'
+      version: 4.101620
+    -
+      class: Dist::Zilla::Plugin::Readme
+      name: '@RJBS/@Basic/Readme'
+      version: 4.101620
+    -
+      class: Dist::Zilla::Plugin::ExtraTests
+      name: '@RJBS/@Basic/ExtraTests'
+      version: 4.101620
+    -
+      class: Dist::Zilla::Plugin::ExecDir
+      name: '@RJBS/@Basic/ExecDir'
+      version: 4.101620
+    -
+      class: Dist::Zilla::Plugin::ShareDir
+      name: '@RJBS/@Basic/ShareDir'
+      version: 4.101620
+    -
+      class: Dist::Zilla::Plugin::MakeMaker
+      name: '@RJBS/@Basic/MakeMaker'
+      version: 4.101620
+    -
+      class: Dist::Zilla::Plugin::Manifest
+      name: '@RJBS/@Basic/Manifest'
+      version: 4.101620
+    -
+      class: Dist::Zilla::Plugin::TestRelease
+      name: '@RJBS/@Basic/TestRelease'
+      version: 4.101620
+    -
+      class: Dist::Zilla::Plugin::ConfirmRelease
+      name: '@RJBS/@Basic/ConfirmRelease'
+      version: 4.101620
+    -
+      class: Dist::Zilla::Plugin::UploadToCPAN
+      name: '@RJBS/@Basic/UploadToCPAN'
+      version: 4.101620
+    -
+      class: Dist::Zilla::Plugin::AutoPrereq
+      name: '@RJBS/AutoPrereq'
+      version: 4.101620
+    -
+      class: Dist::Zilla::Plugin::AutoVersion
+      name: '@RJBS/AutoVersion'
+      version: 4.101620
+    -
+      class: Dist::Zilla::Plugin::PkgVersion
+      name: '@RJBS/PkgVersion'
+      version: 4.101620
+    -
+      class: Dist::Zilla::Plugin::MetaConfig
+      name: '@RJBS/MetaConfig'
+      version: 4.101620
+    -
+      class: Dist::Zilla::Plugin::MetaJSON
+      name: '@RJBS/MetaJSON'
+      version: 4.101620
+    -
+      class: Dist::Zilla::Plugin::NextRelease
+      name: '@RJBS/NextRelease'
+      version: 4.101620
+    -
+      class: Dist::Zilla::Plugin::PodSyntaxTests
+      name: '@RJBS/PodSyntaxTests'
+      version: 4.101620
+    -
+      class: Dist::Zilla::Plugin::Repository
+      name: '@RJBS/Repository'
+      version: 0.13
+    -
+      class: Dist::Zilla::Plugin::PodWeaver
+      name: '@RJBS/PodWeaver'
+      version: 3.101620
+    -
+      class: Dist::Zilla::Plugin::Git::Check
+      name: '@RJBS/@Git/Check'
+      version: 1.101330
+    -
+      class: Dist::Zilla::Plugin::Git::Commit
+      name: '@RJBS/@Git/Commit'
+      version: 1.101330
+    -
+      class: Dist::Zilla::Plugin::Git::Tag
+      name: '@RJBS/@Git/Tag'
+      version: 1.101330
+    -
+      class: Dist::Zilla::Plugin::Git::Push
+      name: '@RJBS/@Git/Push'
+      version: 1.101330
+    -
+      class: Dist::Zilla::Plugin::FinderCode
+      name: ':InstallModules'
+      version: 4.101620
+    -
+      class: Dist::Zilla::Plugin::FinderCode
+      name: ':TestFiles'
+      version: 4.101620
+    -
+      class: Dist::Zilla::Plugin::FinderCode
+      name: ':ExecFiles'
+      version: 4.101620
+    -
+      class: Dist::Zilla::Plugin::FinderCode
+      name: ':ShareFiles'
+      version: 4.101620
+  zilla:
+    class: Dist::Zilla
+    config:
+      is_trial: 0
+    version: 4.101620

Modified: branches/upstream/libstring-formatter-perl/current/Makefile.PL
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libstring-formatter-perl/current/Makefile.PL?rev=59368&op=diff
==============================================================================
--- branches/upstream/libstring-formatter-perl/current/Makefile.PL (original)
+++ branches/upstream/libstring-formatter-perl/current/Makefile.PL Mon Jun 14 02:35:27 2010
@@ -4,35 +4,49 @@
 
  BEGIN { require 5.006; } 
 
-use ExtUtils::MakeMaker 6.11;
+use ExtUtils::MakeMaker 6.31;
 
 
 
 my %WriteMakefileArgs = (
-                       'test' => {
-                                   'TESTS' => 't/*.t'
-                                 },
-                       'NAME' => 'String::Formatter',
-                       'DISTNAME' => 'String-Formatter',
-                       'CONFIGURE_REQUIRES' => {
-                                                 'ExtUtils::MakeMaker' => '6.11'
-                                               },
-                       'AUTHOR' => 'Ricardo Signes <rjbs at cpan.org>, Darren Chamberlain <darren at cpan.org>',
-                       'BUILD_REQUIRES' => {},
-                       'ABSTRACT' => 'build sprintf-like functions of your own',
-                       'EXE_FILES' => [],
-                       'VERSION' => '0.100720',
-                       'PREREQ_PM' => {
-                                        'Test::More' => '0',
-                                        'Params::Util' => '0',
-                                        'Sub::Exporter' => '0'
-                                      },
-                       'LICENSE' => 'gpl'
-                     );
+  'ABSTRACT' => 'build sprintf-like functions of your own',
+  'AUTHOR' => 'Ricardo Signes <rjbs at cpan.org>, Darren Chamberlain <darren at cpan.org>',
+  'BUILD_REQUIRES' => {
+    'Test::More' => '0'
+  },
+  'CONFIGURE_REQUIRES' => {
+    'ExtUtils::MakeMaker' => '6.31'
+  },
+  'DISTNAME' => 'String-Formatter',
+  'EXE_FILES' => [],
+  'LICENSE' => 'gpl',
+  'NAME' => 'String::Formatter',
+  'PREREQ_PM' => {
+    'Params::Util' => '0',
+    'Sub::Exporter' => '0'
+  },
+  'VERSION' => '0.101620',
+  'test' => {
+    'TESTS' => 't/*.t'
+  }
+);
 
 
-delete $WriteMakefileArgs{LICENSE}
-  unless eval { ExtUtils::MakeMaker->VERSION(6.31) };
+unless ( eval { ExtUtils::MakeMaker->VERSION(6.56) } ) {
+  my $br = delete $WriteMakefileArgs{BUILD_REQUIRES};
+  my $pp = $WriteMakefileArgs{PREREQ_PM};
+  for my $mod ( keys %$br ) {
+    if ( exists $pp->{$mod} ) {
+      $pp->{$mod} = $br->{$mod} if $br->{$mod} > $pp->{$mod};
+    }
+    else {
+      $pp->{$mod} = $br->{$mod};
+    }
+  }
+}
+
+delete $WriteMakefileArgs{CONFIGURE_REQUIRES}
+  unless eval { ExtUtils::MakeMaker->VERSION(6.52) };
 
 WriteMakefile(%WriteMakefileArgs);
 

Modified: branches/upstream/libstring-formatter-perl/current/README
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libstring-formatter-perl/current/README?rev=59368&op=diff
==============================================================================
--- branches/upstream/libstring-formatter-perl/current/README (original)
+++ branches/upstream/libstring-formatter-perl/current/README Mon Jun 14 02:35:27 2010
@@ -1,7 +1,7 @@
 
 
-This archive contains the distribution String-Formatter, version
-0.100720:
+This archive contains the distribution String-Formatter,
+version 0.101620:
 
   build sprintf-like functions of your own
 
@@ -11,3 +11,4 @@
 
   The GNU General Public License, Version 2, June 1991
 
+

Modified: branches/upstream/libstring-formatter-perl/current/lib/String/Formatter.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libstring-formatter-perl/current/lib/String/Formatter.pm?rev=59368&op=diff
==============================================================================
--- branches/upstream/libstring-formatter-perl/current/lib/String/Formatter.pm (original)
+++ branches/upstream/libstring-formatter-perl/current/lib/String/Formatter.pm Mon Jun 14 02:35:27 2010
@@ -1,7 +1,9 @@
 use strict;
 use warnings;
 package String::Formatter;
-our $VERSION = '0.100720';
+BEGIN {
+  $String::Formatter::VERSION = '0.101620';
+}
 # ABSTRACT: build sprintf-like functions of your own
 
 
@@ -33,6 +35,15 @@
       });
       return sub { $formatter->format(@_) };
     },
+    indexed_stringf => sub {
+      my ($class, $name, $arg, $col) = @_;
+      my $formatter = $class->new({
+        input_processor => 'require_arrayref_input',
+        string_replacer => 'indexed_replace',
+        %$arg,
+      });
+      return sub { $formatter->format(@_) };
+    },
   },
 };
 
@@ -155,6 +166,16 @@
 }
 
 
+sub require_arrayref_input {
+  my ($self, $args) = @_;
+
+  Carp::croak("routine must be called with exactly one arrayref arg")
+    if @$args != 1 or ! Params::Util::_ARRAYLIKE($args->[0]);
+
+  return $args->[0];
+}
+
+
 sub require_single_input {
   my ($self, $args) = @_;
 
@@ -217,6 +238,12 @@
     local $_ = $arg->{input}->{ $arg->{hunk}{passme} };
     return $arg->{conv}->($self, $_, $arg->{hunk}{passme});
   });
+
+  *indexed_replace = __closure_replace(sub {
+    my ($self, $arg) = @_;
+    local $_ = $arg->{input}->[ $arg->{hunk}{passme} ];
+    return $arg->{conv}->($self, $_, $arg->{hunk}{passme});
+  });
 }
 
 
@@ -272,7 +299,7 @@
 
 =head1 VERSION
 
-version 0.100720
+version 0.101620
 
 =head1 WARNING
 
@@ -339,9 +366,10 @@
 
 There's also a C<named_stringf> export, which behaves just like the C<stringf>
 export, but defaults to the C<named_replace> and C<require_named_input>
-arguments, and a C<method_stringf> export, which defaults C<method_replace> and
-C<require_single_input>.  For more on these, keep reading, and check out the
-cookbook.
+arguments.  There's a C<method_stringf> export, which defaults
+C<method_replace> and C<require_single_input>.  Finally, a C<indexed_stringf>,
+which defaults to C<indexed_replaced> and C<require_arrayref_input>.  For more
+on these, keep reading, and check out the cookbook.
 
 L<String::Formatter::Cookbook> provides a number of recipes for ways to put
 String::Formatter to use.
@@ -389,6 +417,13 @@
 This input processor will raise an exception unless there is exactly one
 post-format-string argument to the format call, and unless that argument is a
 hashref.  It will also replace the arrayref with the given hashref so
+subsequent phases of the format can avoid lots of needless array dereferencing.
+
+=head2 require_arrayref_input
+
+This input processor will raise an exception unless there is exactly one
+post-format-string argument to the format call, and unless that argument is a
+arrayref.  It will also replace the input with that single arrayref it found so
 subsequent phases of the format can avoid lots of needless array dereferencing.
 
 =head2 require_single_input
@@ -440,6 +475,15 @@
     adj => 'best',
     num => 6,
   });
+
+=head2 indexed_replace
+
+This replacer should be used with the C<require_arrayref_input> input
+processor.  It expects the input to be an arrayref and it finds values to be
+interpolated by looking in the arrayref for the brace-enclosed index on each
+format code.  Here's an example use:
+
+  $formatter->format("This was the %{1}s day in %{0}d weeks.", [ 6, 'best' ]);
 
 =head2 method_replace
 

Modified: branches/upstream/libstring-formatter-perl/current/lib/String/Formatter/Cookbook.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libstring-formatter-perl/current/lib/String/Formatter/Cookbook.pm?rev=59368&op=diff
==============================================================================
--- branches/upstream/libstring-formatter-perl/current/lib/String/Formatter/Cookbook.pm (original)
+++ branches/upstream/libstring-formatter-perl/current/lib/String/Formatter/Cookbook.pm Mon Jun 14 02:35:27 2010
@@ -1,7 +1,9 @@
 use strict;
 use warnings;
 package String::Formatter::Cookbook;
-our $VERSION = '0.100720';
+BEGIN {
+  $String::Formatter::Cookbook::VERSION = '0.101620';
+}
 # ABSTRACT: ways to put String::Formatter to use
 1;
 
@@ -15,7 +17,7 @@
 
 =head1 VERSION
 
-version 0.100720
+version 0.101620
 
 =head1 OVERVIEW
 

Modified: branches/upstream/libstring-formatter-perl/current/t/release-pod-syntax.t
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libstring-formatter-perl/current/t/release-pod-syntax.t?rev=59368&op=diff
==============================================================================
--- branches/upstream/libstring-formatter-perl/current/t/release-pod-syntax.t (original)
+++ branches/upstream/libstring-formatter-perl/current/t/release-pod-syntax.t Mon Jun 14 02:35:27 2010
@@ -9,7 +9,7 @@
 
 use Test::More;
 
-eval "use Test::Pod 1.00";
-plan skip_all => "Test::Pod 1.00 required for testing POD" if $@;
+eval "use Test::Pod 1.41";
+plan skip_all => "Test::Pod 1.41 required for testing POD" if $@;
 
-all_pod_files_ok();
+all_pod_files_ok();

Modified: branches/upstream/libstring-formatter-perl/current/t/stringf.t
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libstring-formatter-perl/current/t/stringf.t?rev=59368&op=diff
==============================================================================
--- branches/upstream/libstring-formatter-perl/current/t/stringf.t (original)
+++ branches/upstream/libstring-formatter-perl/current/t/stringf.t Mon Jun 14 02:35:27 2010
@@ -1,7 +1,7 @@
 #!perl
 use strict;
 
-use Test::More tests => 3;
+use Test::More;
 
 use String::Formatter
   stringf => {
@@ -27,6 +27,12 @@
       r => sub { scalar reverse $_ },
     },
   },
+  indexed_stringf => {
+    codes           => {
+      f => sub { $_ },
+      r => sub { scalar reverse $_ },
+    },
+  }
 ;
 
 {
@@ -59,3 +65,14 @@
   is($have, $want, "named args via conversions (named_stringf import)");
 }
 
+{
+  my $have = indexed_stringf(
+    q(do it %{1}f way and %{0}r way),
+    [ qw(that this) ],
+  );
+  my $want = 'do it this way and taht way';
+
+  is($have, $want, "named args via conversions (indexed_stringf import)");
+}
+
+done_testing;




More information about the Pkg-perl-cvs-commits mailing list