r54282 - in /trunk/libdatetime-format-natural-perl: ./ debian/ debian/source/ lib/DateTime/Format/ lib/DateTime/Format/Natural/ lib/DateTime/Format/Natural/Lang/ t/

jawnsy-guest at users.alioth.debian.org jawnsy-guest at users.alioth.debian.org
Sun Mar 14 03:32:51 UTC 2010


Author: jawnsy-guest
Date: Sun Mar 14 03:32:45 2010
New Revision: 54282

URL: http://svn.debian.org/wsvn/pkg-perl/?sc=1&rev=54282
Log:
* New upstream release
* Use new 3.0 (quilt) source format
* Package no longer uses M::B::Compat, drop dep on dh 7.0.17
* Update copyright information

Added:
    trunk/libdatetime-format-natural-perl/debian/source/
    trunk/libdatetime-format-natural-perl/debian/source/format
Removed:
    trunk/libdatetime-format-natural-perl/debian/README.source
Modified:
    trunk/libdatetime-format-natural-perl/Changes
    trunk/libdatetime-format-natural-perl/META.yml
    trunk/libdatetime-format-natural-perl/debian/changelog
    trunk/libdatetime-format-natural-perl/debian/control
    trunk/libdatetime-format-natural-perl/debian/copyright
    trunk/libdatetime-format-natural-perl/debian/rules
    trunk/libdatetime-format-natural-perl/lib/DateTime/Format/Natural.pm
    trunk/libdatetime-format-natural-perl/lib/DateTime/Format/Natural/Aliases.pm
    trunk/libdatetime-format-natural-perl/lib/DateTime/Format/Natural/Formatted.pm
    trunk/libdatetime-format-natural-perl/lib/DateTime/Format/Natural/Lang/Base.pm
    trunk/libdatetime-format-natural-perl/lib/DateTime/Format/Natural/Lang/EN.pm
    trunk/libdatetime-format-natural-perl/t/02-parse_format.t

Modified: trunk/libdatetime-format-natural-perl/Changes
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libdatetime-format-natural-perl/Changes?rev=54282&op=diff
==============================================================================
--- trunk/libdatetime-format-natural-perl/Changes (original)
+++ trunk/libdatetime-format-natural-perl/Changes Sun Mar 14 03:32:45 2010
@@ -1,4 +1,28 @@
 Revision history for Perl extension DateTime::Format::Natural.
+
+0.85  2010-03-13  <schubiger at cpan.org>
+
+ - Merged development version to stable.
+
+0.84_03  2010-03-11  <schubiger at cpan.org>
+
+ - Resolve short aliases only if preceded by a digit.
+
+ - Don't capture the date separator for matching with the format.
+
+0.84_02  2010-03-09  <schubiger at cpan.org>
+
+ - Guess the format of dates with a dot or hyphen as separator.
+
+ - Check for separator mismatch when not in lax mode.
+
+0.84_01  2010-02-24  <schubiger at cpan.org>
+
+ - Use the format parameter case-insensitively and test it.
+
+ - Don't bless into a reference within the metadata base constructor.
+
+ - Add some missing commas to the grammar description.
 
 0.84  2010-02-22  <schubiger at cpan.org>
 

Modified: trunk/libdatetime-format-natural-perl/META.yml
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libdatetime-format-natural-perl/META.yml?rev=54282&op=diff
==============================================================================
--- trunk/libdatetime-format-natural-perl/META.yml (original)
+++ trunk/libdatetime-format-natural-perl/META.yml Sun Mar 14 03:32:45 2010
@@ -1,6 +1,6 @@
 ---
 name: DateTime-Format-Natural
-version: 0.84
+version: 0.85
 author:
   - 'Steven Schubiger <schubiger at cpan.org>'
 abstract: Create machine readable date/time with natural parsing logic
@@ -29,10 +29,10 @@
 provides:
   DateTime::Format::Natural:
     file: lib/DateTime/Format/Natural.pm
-    version: 0.84
+    version: 0.85
   DateTime::Format::Natural::Aliases:
     file: lib/DateTime/Format/Natural/Aliases.pm
-    version: 0.02
+    version: 0.03
   DateTime::Format::Natural::Base:
     file: lib/DateTime/Format/Natural/Base.pm
     version: 1.31
@@ -44,16 +44,16 @@
     version: 0.04
   DateTime::Format::Natural::Formatted:
     file: lib/DateTime/Format/Natural/Formatted.pm
-    version: 0.01
+    version: 0.04
   DateTime::Format::Natural::Helpers:
     file: lib/DateTime/Format/Natural/Helpers.pm
     version: 0.05
   DateTime::Format::Natural::Lang::Base:
     file: lib/DateTime/Format/Natural/Lang/Base.pm
-    version: 1.04
+    version: 1.05
   DateTime::Format::Natural::Lang::EN:
     file: lib/DateTime/Format/Natural/Lang/EN.pm
-    version: 1.31
+    version: 1.33
   DateTime::Format::Natural::Test:
     file: lib/DateTime/Format/Natural/Test.pm
     version: 0.05

Modified: trunk/libdatetime-format-natural-perl/debian/changelog
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libdatetime-format-natural-perl/debian/changelog?rev=54282&op=diff
==============================================================================
--- trunk/libdatetime-format-natural-perl/debian/changelog (original)
+++ trunk/libdatetime-format-natural-perl/debian/changelog Sun Mar 14 03:32:45 2010
@@ -1,3 +1,12 @@
+libdatetime-format-natural-perl (0.85-1) UNRELEASED; urgency=low
+
+  * New upstream release
+  * Use new 3.0 (quilt) source format
+  * Package no longer uses M::B::Compat, drop dep on dh 7.0.17
+  * Update copyright information
+
+ -- Jonathan Yu <jawnsy at cpan.org>  Sat, 13 Mar 2010 23:00:49 -0500
+
 libdatetime-format-natural-perl (0.84-1) unstable; urgency=low
 
   [ Angel Abad ]

Modified: trunk/libdatetime-format-natural-perl/debian/control
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libdatetime-format-natural-perl/debian/control?rev=54282&op=diff
==============================================================================
--- trunk/libdatetime-format-natural-perl/debian/control (original)
+++ trunk/libdatetime-format-natural-perl/debian/control Sun Mar 14 03:32:45 2010
@@ -1,8 +1,7 @@
 Source: libdatetime-format-natural-perl
 Section: perl
 Priority: optional
-Build-Depends: debhelper (>= 7.0.17), quilt (>= 0.46-7),
- perl (>= 5.10) | libmodule-build-perl
+Build-Depends: debhelper (>= 7)
 Build-Depends-Indep: libboolean-perl, libdate-calc-perl, libdatetime-perl,
  liblist-moreutils-perl, libparams-validate-perl, libtest-mocktime-perl,
  libtest-pod-coverage-perl, libtest-pod-perl, perl

Modified: trunk/libdatetime-format-natural-perl/debian/copyright
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libdatetime-format-natural-perl/debian/copyright?rev=54282&op=diff
==============================================================================
--- trunk/libdatetime-format-natural-perl/debian/copyright (original)
+++ trunk/libdatetime-format-natural-perl/debian/copyright Sun Mar 14 03:32:45 2010
@@ -20,13 +20,12 @@
      See http://www.perl.com/perl/misc/Artistic.html
 
 Files: debian/*
-Copyright: 2008, 2009, Ansgar Burchardt <ansgar at 43-1.org>
+Copyright: 2009-2010, Jonathan Yu <jawnsy at cpan.org>
+ 2010, Angel Abad <angelabad at gmail.com>
+ 2009, Salvatore Bonaccorso <salvatore.bonaccorso at gmail.com>
+ 2008-2009, Ansgar Burchardt <ansgar at 43-1.org>
+ 2009, Rene Mayorga <rmayorga at debian.org>
  2008, gregor herrmann <gregoa at debian.org>
- 2009, Jonathan Yu <jawnsy at cpan.org>
- 2009, Rene Mayorga <rmayorga at debian.org>
- 2009, Salvatore Bonaccorso <salvatore.bonaccorso at gmail.com>
- 2010, Angel Abad <angelabad at gmail.com>
- 2010, various members of the Debian Perl Group, cf. debian/changelog
 License: Artistic or GPL-1+
 
 License: Artistic

Modified: trunk/libdatetime-format-natural-perl/debian/rules
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libdatetime-format-natural-perl/debian/rules?rev=54282&op=diff
==============================================================================
--- trunk/libdatetime-format-natural-perl/debian/rules (original)
+++ trunk/libdatetime-format-natural-perl/debian/rules Sun Mar 14 03:32:45 2010
@@ -1,4 +1,4 @@
 #!/usr/bin/make -f
 
 %:
-	dh --with quilt $@
+	dh $@

Added: trunk/libdatetime-format-natural-perl/debian/source/format
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libdatetime-format-natural-perl/debian/source/format?rev=54282&op=file
==============================================================================
--- trunk/libdatetime-format-natural-perl/debian/source/format (added)
+++ trunk/libdatetime-format-natural-perl/debian/source/format Sun Mar 14 03:32:45 2010
@@ -1,0 +1,1 @@
+3.0 (quilt)

Modified: trunk/libdatetime-format-natural-perl/lib/DateTime/Format/Natural.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libdatetime-format-natural-perl/lib/DateTime/Format/Natural.pm?rev=54282&op=diff
==============================================================================
--- trunk/libdatetime-format-natural-perl/lib/DateTime/Format/Natural.pm (original)
+++ trunk/libdatetime-format-natural-perl/lib/DateTime/Format/Natural.pm Sun Mar 14 03:32:45 2010
@@ -18,7 +18,7 @@
 use Scalar::Util qw(blessed);
 use Storable qw(dclone);
 
-our $VERSION = '0.84';
+our $VERSION = '0.85';
 
 validation_options(
     on_fail => sub

Modified: trunk/libdatetime-format-natural-perl/lib/DateTime/Format/Natural/Aliases.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libdatetime-format-natural-perl/lib/DateTime/Format/Natural/Aliases.pm?rev=54282&op=diff
==============================================================================
--- trunk/libdatetime-format-natural-perl/lib/DateTime/Format/Natural/Aliases.pm (original)
+++ trunk/libdatetime-format-natural-perl/lib/DateTime/Format/Natural/Aliases.pm Sun Mar 14 03:32:45 2010
@@ -3,7 +3,7 @@
 use strict;
 use warnings;
 
-our $VERSION = '0.02';
+our $VERSION = '0.03';
 
 sub _rewrite_aliases
 {
@@ -13,7 +13,7 @@
     my $aliases = $self->{data}->{aliases};
 
     if ($$date_string =~ /\s+/) {
-        foreach my $type (qw(all tokens)) {
+        foreach my $type (qw(words tokens)) {
             foreach my $alias (keys %{$aliases->{$type}}) {
                 if ($alias =~ /^\w+$/) {
                     $$date_string =~ s/\b $alias \b/$aliases->{$type}{$alias}/ix;
@@ -25,10 +25,11 @@
         }
     }
     else {
-        foreach my $type (qw(all short)) {
-            foreach my $alias (keys %{$aliases->{$type}}) {
-                $$date_string =~ s/$alias $/$aliases->{$type}{$alias}/ix;
-            }
+        foreach my $alias (keys %{$aliases->{words}}) {
+            $$date_string =~ s/^ $alias $/$aliases->{words}{$alias}/ix;
+        }
+        foreach my $alias (keys %{$aliases->{short}}) {
+            $$date_string =~ s/(?<=\d) $alias $/$aliases->{short}{$alias}/ix;
         }
     }
 }

Modified: trunk/libdatetime-format-natural-perl/lib/DateTime/Format/Natural/Formatted.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libdatetime-format-natural-perl/lib/DateTime/Format/Natural/Formatted.pm?rev=54282&op=diff
==============================================================================
--- trunk/libdatetime-format-natural-perl/lib/DateTime/Format/Natural/Formatted.pm (original)
+++ trunk/libdatetime-format-natural-perl/lib/DateTime/Format/Natural/Formatted.pm Sun Mar 14 03:32:45 2010
@@ -2,9 +2,9 @@
 
 use strict;
 use warnings;
-use boolean qw(true);
+use boolean qw(true false);
 
-our $VERSION = '0.01';
+our $VERSION = '0.04';
 
 sub _parse_formatted_ymd
 {
@@ -13,16 +13,19 @@
 
     my $date = $self->_split_formatted($date_string);
 
-    my $separator = quotemeta((keys %$count)[0]);
-    my @chunks = split /$separator/, $date;
+    my $date_sep = quotemeta((keys %$count)[0]);
+    my @chunks = split /$date_sep/, $date;
 
     my $i = 0;
     my %length = map { length $_ => $i++ } @chunks;
 
-    my $format = $self->{Format};
+    my $format = lc $self->{Format};
+    my $format_sep;
+
+    my $lax = false;
 
     if (exists $length{4}) {
-        $format = join $separator,
+        $format = join $date_sep,
           ($length{4} == 0
             ? qw(yyyy mm dd)
             : ($format =~ /^m/
@@ -30,15 +33,27 @@
                 : qw(dd mm yyyy)
               )
           );
+        $lax = true;
+    }
+    elsif ($date_sep =~ /^\\[-.]$/ and $format !~ /$date_sep/) {
+        $format = join $date_sep, qw(dd mm yy);
+        $lax = true;
     }
     else {
-        $separator = do { local $_ = $format;
-                          tr/a-zA-Z//d;
-                          tr/a-zA-Z//cs;
-                          quotemeta; };
+        $format_sep = do { local $_ = $format;
+                           tr/a-zA-Z//d;
+                           tr/a-zA-Z//cs;
+                           quotemeta; };
+    }
+    $format_sep ||= $date_sep;
+
+    if (not $lax and ($format_sep ne $date_sep)) {
+        $self->_set_failure;
+        $self->_set_error("(mismatch between format and date separator)");
+        return $self->_get_datetime_object;
     }
 
-    my @separated_order = split /$separator/, $format;
+    my @separated_order = split /$format_sep/, $format;
 
     my ($d, $m, $y) = do {
         my %f = map { substr($_, 0, 1) => true } @separated_order;
@@ -53,7 +68,7 @@
     my $separated_index = 0;
     my $separated_indices = { map { substr($_, 0, 1) => $separated_index++ } @separated_order };
 
-    my @bits = split /$separator/, $date;
+    my @bits = split /$date_sep/, $date;
 
     my $century = $self->{datetime}
                 ? int($self->{datetime}->year / 100)

Modified: trunk/libdatetime-format-natural-perl/lib/DateTime/Format/Natural/Lang/Base.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libdatetime-format-natural-perl/lib/DateTime/Format/Natural/Lang/Base.pm?rev=54282&op=diff
==============================================================================
--- trunk/libdatetime-format-natural-perl/lib/DateTime/Format/Natural/Lang/Base.pm (original)
+++ trunk/libdatetime-format-natural-perl/lib/DateTime/Format/Natural/Lang/Base.pm Sun Mar 14 03:32:45 2010
@@ -5,7 +5,7 @@
 
 our ($VERSION, $AUTOLOAD);
 
-$VERSION = '1.04';
+$VERSION = '1.05';
 
 sub __new
 {
@@ -25,7 +25,7 @@
     $obj->{duration}        = \%{"${class}::data_duration"};
     $obj->{aliases}         = \%{"${class}::data_aliases"};
 
-    return bless $obj, ref($class) || $class;
+    return bless $obj, $class;
 }
 
 AUTOLOAD

Modified: trunk/libdatetime-format-natural-perl/lib/DateTime/Format/Natural/Lang/EN.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libdatetime-format-natural-perl/lib/DateTime/Format/Natural/Lang/EN.pm?rev=54282&op=diff
==============================================================================
--- trunk/libdatetime-format-natural-perl/lib/DateTime/Format/Natural/Lang/EN.pm (original)
+++ trunk/libdatetime-format-natural-perl/lib/DateTime/Format/Natural/Lang/EN.pm Sun Mar 14 03:32:45 2010
@@ -9,7 +9,7 @@
 
 use DateTime::Format::Natural::Helpers qw(%flag);
 
-our $VERSION = '1.31';
+our $VERSION = '1.33';
 
 our (%init,
      %timespan,
@@ -112,13 +112,13 @@
     );
 
     %data_aliases = (
-        all => {
+        words => {
             tues  => 'tue',
             thurs => 'thu',
         },
         tokens => {
-            mins  => 'minutes',
-            '@'   => 'at',
+            mins => 'minutes',
+            '@'  => 'at',
         },
         short => {
             min => 'minute',
@@ -159,11 +159,11 @@
 #    [
 #      { <token index> => <token value>, ... }, ------------> declares the index <-> value map
 #      [ [ <index(es) of token(s) to be passed> ], ... ], --> declares which tokens will be passed to the extended check(s)
-#      [ <subroutine(s) for extended check(s)>, ... ] ------> declares the extended check(s)
+#      [ <subroutine(s) for extended check(s)>, ... ], -----> declares the extended check(s)
 #      [ [ <index(es) of token(s) to be passed> ], ... ], --> declares which tokens will be passed to the worker method(s)
-#      [ { <additional options to be passed> }, ... ] ------> declares additional options
+#      [ { <additional options to be passed> }, ... ], -----> declares additional options
 #      [ <name of method to dispatch to>, ... ], -----------> declares the worker method(s)
-#      { <shared option>, ... } ----------------------------> declares shared options (post-processed)
+#      { <shared option>, ... }, ---------------------------> declares shared options (post-processed)
 #    ],
 
 %grammar = (

Modified: trunk/libdatetime-format-natural-perl/t/02-parse_format.t
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libdatetime-format-natural-perl/t/02-parse_format.t?rev=54282&op=diff
==============================================================================
--- trunk/libdatetime-format-natural-perl/t/02-parse_format.t (original)
+++ trunk/libdatetime-format-natural-perl/t/02-parse_format.t Sun Mar 14 03:32:45 2010
@@ -13,11 +13,13 @@
     { '05/27/79'            => [ '27.05.2079 00:00:00', 'mm/dd/yy'   ] },
     { '1979-05-27'          => [ '27.05.1979 00:00:00', 'yyyy-mm-dd' ] },
     { '1979-05-27 21:09:14' => [ '27.05.1979 21:09:14', 'yyyy-mm-dd' ] },
+    { '31.12.99'            => [ '31.12.2099 00:00:00', undef        ] },
+    { '31-12-99'            => [ '31.12.2099 00:00:00', undef        ] },
     { '1/3'                 => [ '03.01.2006 00:00:00', undef        ] },
     { '1/3 16:00'           => [ '03.01.2006 16:00:00', undef        ] },
 );
 
-_run_tests(7, [ [ \@specific ] ], \&compare);
+_run_tests(9, [ [ \@specific ] ], \&compare);
 
 sub compare
 {
@@ -25,8 +27,12 @@
 
     foreach my $href (@$aref) {
         my $key = (keys %$href)[0];
-        foreach my $string ($case_strings->($key)) {
-            compare_strings($string, $href->{$key}->[0], $href->{$key}->[1]);
+        my @formats = do {
+            local $_ = $href->{$key}->[1];
+            defined ($_) ? $case_strings->($_) : (undef) x 3;
+        };
+        foreach my $format (@formats) {
+            compare_strings($key, $href->{$key}->[0], $format);
         }
     }
 }




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