r54315 - in /branches/upstream/libstring-formatter-perl/current: Changes LICENSE MANIFEST META.json META.yml Makefile.PL README bench.pl lib/String/Formatter.pm lib/String/Formatter/Cookbook.pm t/02basic.t t/basic.t
jawnsy-guest at users.alioth.debian.org
jawnsy-guest at users.alioth.debian.org
Sun Mar 14 16:38:40 UTC 2010
Author: jawnsy-guest
Date: Sun Mar 14 16:38:33 2010
New Revision: 54315
URL: http://svn.debian.org/wsvn/pkg-perl/?sc=1&rev=54315
Log:
[svn-upgrade] Integrating new upstream version, libstring-formatter-perl (0.100720)
Added:
branches/upstream/libstring-formatter-perl/current/t/basic.t
Removed:
branches/upstream/libstring-formatter-perl/current/t/02basic.t
Modified:
branches/upstream/libstring-formatter-perl/current/Changes
branches/upstream/libstring-formatter-perl/current/LICENSE
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/bench.pl
branches/upstream/libstring-formatter-perl/current/lib/String/Formatter.pm
branches/upstream/libstring-formatter-perl/current/lib/String/Formatter/Cookbook.pm
Modified: branches/upstream/libstring-formatter-perl/current/Changes
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libstring-formatter-perl/current/Changes?rev=54315&op=diff
==============================================================================
--- branches/upstream/libstring-formatter-perl/current/Changes (original)
+++ branches/upstream/libstring-formatter-perl/current/Changes Sun Mar 14 16:38:33 2010
@@ -1,4 +1,14 @@
Revision history for String-Formatter
+
+0.100720 2010-03-13 09:36:03 America/New_York
+ fix an ancillary file that brought in a bunch of bogus prereqs
+
+0.100690 2010-03-10 21:09:36 America/New_York
+ fix a 5.10-ism that slipped in
+
+0.100680 2010-03-09 20:54:11 America/New_York
+ bug fix: newlines no longer end formatting, but not allowed in braces
+ (thanks for bug report, Christopher J. Madsen)
0.093221 2009-11-18 08:13:22 America/New_York
remove stupidly left-in hardcoded version!
Modified: branches/upstream/libstring-formatter-perl/current/LICENSE
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libstring-formatter-perl/current/LICENSE?rev=54315&op=diff
==============================================================================
--- branches/upstream/libstring-formatter-perl/current/LICENSE (original)
+++ branches/upstream/libstring-formatter-perl/current/LICENSE Sun Mar 14 16:38:33 2010
@@ -1,4 +1,4 @@
-This software is Copyright (c) 2009 by Ricardo Signes <rjbs at cpan.org>.
+This software is Copyright (c) 2010 by Ricardo Signes <rjbs at cpan.org>.
This is free software, licensed under:
Modified: branches/upstream/libstring-formatter-perl/current/MANIFEST
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libstring-formatter-perl/current/MANIFEST?rev=54315&op=diff
==============================================================================
--- branches/upstream/libstring-formatter-perl/current/MANIFEST (original)
+++ branches/upstream/libstring-formatter-perl/current/MANIFEST Sun Mar 14 16:38:33 2010
@@ -10,7 +10,7 @@
lib/String/Formatter.pm
lib/String/Formatter/Cookbook.pm
notes.txt
-t/02basic.t
+t/basic.t
t/braces.t
t/method.t
t/params.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=54315&op=diff
==============================================================================
--- branches/upstream/libstring-formatter-perl/current/META.json (original)
+++ branches/upstream/libstring-formatter-perl/current/META.json Sun Mar 14 16:38:33 2010
@@ -1,23 +1,29 @@
{
"resources" : {
- "repository" : "http://github.com/rjbs/string-formatter"
+ "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.093220",
- "version" : "0.093221",
+ "generated_by" : "Dist::Zilla version 1.100710",
+ "version" : "0.100720",
"name" : "String-Formatter",
"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"
},
- "abstract" : "build sprintf-like functions of your own"
+ "abstract" : "build sprintf-like functions of your own",
+ "configure_requires" : {
+ "ExtUtils::MakeMaker" : "6.11"
+ }
}
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=54315&op=diff
==============================================================================
--- branches/upstream/libstring-formatter-perl/current/META.yml (original)
+++ branches/upstream/libstring-formatter-perl/current/META.yml Sun Mar 14 16:38:33 2010
@@ -3,7 +3,10 @@
author:
- 'Ricardo Signes <rjbs at cpan.org>'
- 'Darren Chamberlain <darren at cpan.org>'
-generated_by: 'Dist::Zilla version 1.093220'
+build_requires: {}
+configure_requires:
+ ExtUtils::MakeMaker: 6.11
+generated_by: 'Dist::Zilla version 1.100710'
license: gpl
meta-spec:
url: http://module-build.sourceforge.net/META-spec-v1.4.html
@@ -12,6 +15,8 @@
requires:
Params::Util: 0
Sub::Exporter: 0
+ Test::More: 0
+ perl: 5.006
resources:
- repository: http://github.com/rjbs/string-formatter
-version: 0.093221
+ repository: git://git.codesimply.com/String-Formatter.git
+version: 0.100720
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=54315&op=diff
==============================================================================
--- branches/upstream/libstring-formatter-perl/current/Makefile.PL (original)
+++ branches/upstream/libstring-formatter-perl/current/Makefile.PL Sun Mar 14 16:38:33 2010
@@ -2,22 +2,39 @@
use strict;
use warnings;
+ BEGIN { require 5.006; }
+
+use ExtUtils::MakeMaker 6.11;
-use ExtUtils::MakeMaker;
-WriteMakefile(
- DISTNAME => 'String-Formatter',
- NAME => 'String::Formatter',
- AUTHOR => "Ricardo\ Signes\ \<rjbs\@cpan\.org\>\,\ Darren\ Chamberlain\ \<darren\@cpan\.org\>",
- ABSTRACT => "build\ sprintf\-like\ functions\ of\ your\ own",
- VERSION => '0.093221',
- EXE_FILES => [ qw() ],
- (eval { ExtUtils::MakeMaker->VERSION(6.31) } ? (LICENSE => 'gpl') : ()),
- PREREQ_PM => {
- "Params::Util" => '0',
- "Sub::Exporter" => '0',
- },
- test => {TESTS => 't/*.t'}
-);
+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'
+ );
+
+delete $WriteMakefileArgs{LICENSE}
+ unless eval { ExtUtils::MakeMaker->VERSION(6.31) };
+
+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=54315&op=diff
==============================================================================
--- branches/upstream/libstring-formatter-perl/current/README (original)
+++ branches/upstream/libstring-formatter-perl/current/README Sun Mar 14 16:38:33 2010
@@ -1,11 +1,11 @@
This archive contains the distribution String-Formatter, version
-0.093221:
+0.100720:
build sprintf-like functions of your own
-This software is Copyright (c) 2009 by Ricardo Signes <rjbs at cpan.org>.
+This software is Copyright (c) 2010 by Ricardo Signes <rjbs at cpan.org>.
This is free software, licensed under:
Modified: branches/upstream/libstring-formatter-perl/current/bench.pl
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libstring-formatter-perl/current/bench.pl?rev=54315&op=diff
==============================================================================
--- branches/upstream/libstring-formatter-perl/current/bench.pl (original)
+++ branches/upstream/libstring-formatter-perl/current/bench.pl Sun Mar 14 16:38:33 2010
@@ -1,11 +1,15 @@
+#!perl -l
use strict;
-use 5.010;
use lib 'lib';
-use Benchmark;
-use String::Format;
use String::Formatter;
-use Template;
+
+# Ha ha ha. I am avoiding AutoPrereq from the following.
+eval "
+ use Benchmark;
+ use Template;
+ use String::Format;
+";
my $hash = {
a => 'apples',
@@ -20,11 +24,11 @@
my $tt2 = Template->new;
-say $index_format->("I like to eat %a and %b.");
-say $fmt->format("I like to eat %a and %b.");
+print $index_format->("I like to eat %a and %b.");
+print $fmt->format("I like to eat %a and %b.");
$tt2->process(\'I like to eat [%a%] and [%b%].', $hash, \my $str);
-say $str;
+print $str;
timethese(100_000, {
dlc => sub { $index_format->("I like to eat %a and %b.") },
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=54315&op=diff
==============================================================================
--- branches/upstream/libstring-formatter-perl/current/lib/String/Formatter.pm (original)
+++ branches/upstream/libstring-formatter-perl/current/lib/String/Formatter.pm Sun Mar 14 16:38:33 2010
@@ -1,9 +1,7 @@
use strict;
use warnings;
package String::Formatter;
-our $VERSION = '0.093221';
-
-
+our $VERSION = '0.100720';
# ABSTRACT: build sprintf-like functions of your own
@@ -123,7 +121,7 @@
my @to_fmt;
my $pos = 0;
- while ($string =~ m{\G(.*?)$regex}g) {
+ while ($string =~ m{\G(.*?)$regex}gs) {
push @to_fmt, $1, {
orig => $2,
alignment => $3,
@@ -274,7 +272,7 @@
=head1 VERSION
-version 0.093221
+version 0.100720
=head1 WARNING
@@ -517,27 +515,27 @@
The other four arguments change how the formatting occurs. Formatting happens
in five phases:
-=over
-
-=item 1.
+=over 4
+
+=item 1
format_hunker - format string is broken down into fixed and %-code hunks
-=item 2.
+=item 2
input_processor - the other inputs are validated and processed
-=item 3.
+=item 3
string_replacer - replacement strings are generated by using conversions
-=item 4.
+=item 4
hunk_formatter - replacement strings in hunks are formatted
-=item 5.
-
-all hunks, now strings, are recombined; this phase is just C<<< join >>>
+=item 5
+
+all hunks, now strings, are recombined; this phase is just C<join>
=back
@@ -559,7 +557,7 @@
=head1 COPYRIGHT AND LICENSE
-This software is Copyright (c) 2009 by Ricardo Signes <rjbs at cpan.org>.
+This software is Copyright (c) 2010 by Ricardo Signes <rjbs at cpan.org>.
This is free software, licensed under:
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=54315&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 Sun Mar 14 16:38:33 2010
@@ -1,9 +1,7 @@
use strict;
use warnings;
package String::Formatter::Cookbook;
-our $VERSION = '0.093221';
-
-
+our $VERSION = '0.100720';
# ABSTRACT: ways to put String::Formatter to use
1;
@@ -17,7 +15,7 @@
=head1 VERSION
-version 0.093221
+version 0.100720
=head1 OVERVIEW
@@ -157,9 +155,6 @@
You can easily use this to implement an actual stringf-like method:
package MyClass;
-our $VERSION = '0.093221';
-
-
use String::Formatter method_stringf => {
-as => '_stringf',
@@ -182,7 +177,7 @@
=head1 COPYRIGHT AND LICENSE
-This software is Copyright (c) 2009 by Ricardo Signes <rjbs at cpan.org>.
+This software is Copyright (c) 2010 by Ricardo Signes <rjbs at cpan.org>.
This is free software, licensed under:
Added: branches/upstream/libstring-formatter-perl/current/t/basic.t
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libstring-formatter-perl/current/t/basic.t?rev=54315&op=file
==============================================================================
--- branches/upstream/libstring-formatter-perl/current/t/basic.t (added)
+++ branches/upstream/libstring-formatter-perl/current/t/basic.t Sun Mar 14 16:38:33 2010
@@ -1,0 +1,91 @@
+#!perl
+use strict;
+
+use Test::More tests => 11;
+
+use String::Formatter;
+
+my $fmt = String::Formatter->new({
+ codes => {
+ a => "apples",
+ b => "bananas",
+ g => "grapefruits",
+ m => "melons",
+ w => "watermelons",
+ '*' => 'brussel sprouts',
+ },
+});
+
+{
+ my $have = $fmt->format(qq(please have some %w\n));
+ my $want = "please have some watermelons\n";
+
+ is($have, $want, "formatting with no text after last code");
+}
+
+{
+ my $have = $fmt->format(qq(w: %w\nb: %b\n));
+ my $want = "w: watermelons\nb: bananas\n";
+
+ is($have, $want, "format with multiple newlines");
+}
+
+{
+ my $have = $fmt->format(q(10%% discount on %w));
+ my $want = '10% discount on watermelons';
+
+ is($have, $want, "%% -> %");
+}
+
+{
+ my $have = $fmt->format(q(I like %a, %b, and %g, but not %m or %w.));
+ my $want = 'I like apples, bananas, and grapefruits, '
+ . 'but not melons or watermelons.';
+
+ is($have, $want, "formatting with text after last code");
+}
+
+{
+ my $have = $fmt->format(q(This has no stuff.));
+ my $want = 'This has no stuff.';
+
+ is($have, $want, "formatting with no %codes");
+}
+
+{
+ my $ok = eval { $fmt->format(q(What is %z for?)); 1 };
+ my $error = $@;
+ like($error, qr/Unknown conversion/i, 'unknown conversions are fatal');
+}
+
+{
+ my $have = $fmt->format("We have %.5w.");
+ my $want = "We have water.";
+ is($have, $want, "truncate at max_chars");
+}
+
+{
+ my $have = $fmt->format("We have %10a.");
+ my $want = "We have apples.";
+ is($have, $want, "left-pad to reach min_chars");
+}
+
+{
+ my $have = $fmt->format("We have %10.a.");
+ my $want = "We have apples.";
+ is($have, $want, "left-pad to reach min_chars (with dot)");
+}
+
+{
+ my $have = $fmt->format("We have %-10a.");
+ my $want = "We have apples .";
+ is($have, $want, "right-pad to reach min_chars (-10)");
+}
+
+{
+ my $have = $fmt->format('Please do not mention the %*.');
+ my $want = 'Please do not mention the brussel sprouts.';
+ is($have, $want, "non-identifier format characters");
+}
+
+
More information about the Pkg-perl-cvs-commits
mailing list