r56586 - in /branches/upstream/libdatetime-format-natural-perl/current: ./ lib/DateTime/Format/ lib/DateTime/Format/Natural/ lib/DateTime/Format/Natural/Lang/ t/

angelabad-guest at users.alioth.debian.org angelabad-guest at users.alioth.debian.org
Tue Apr 20 14:34:27 UTC 2010


Author: angelabad-guest
Date: Tue Apr 20 14:33:54 2010
New Revision: 56586

URL: http://svn.debian.org/wsvn/pkg-perl/?sc=1&rev=56586
Log:
[svn-upgrade] Integrating new upstream version, libdatetime-format-natural-perl (0.86)

Modified:
    branches/upstream/libdatetime-format-natural-perl/current/Changes
    branches/upstream/libdatetime-format-natural-perl/current/META.yml
    branches/upstream/libdatetime-format-natural-perl/current/README
    branches/upstream/libdatetime-format-natural-perl/current/lib/DateTime/Format/Natural.pm
    branches/upstream/libdatetime-format-natural-perl/current/lib/DateTime/Format/Natural/Base.pm
    branches/upstream/libdatetime-format-natural-perl/current/lib/DateTime/Format/Natural/Lang/Base.pm
    branches/upstream/libdatetime-format-natural-perl/current/lib/DateTime/Format/Natural/Lang/EN.pm
    branches/upstream/libdatetime-format-natural-perl/current/t/01-parse.t
    branches/upstream/libdatetime-format-natural-perl/current/t/02-parse_format.t
    branches/upstream/libdatetime-format-natural-perl/current/t/06-parse_prefer_future.t

Modified: branches/upstream/libdatetime-format-natural-perl/current/Changes
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libdatetime-format-natural-perl/current/Changes?rev=56586&op=diff
==============================================================================
--- branches/upstream/libdatetime-format-natural-perl/current/Changes (original)
+++ branches/upstream/libdatetime-format-natural-perl/current/Changes Tue Apr 20 14:33:54 2010
@@ -1,4 +1,23 @@
 Revision history for Perl extension DateTime::Format::Natural.
+
+0.86  2010-04-20  <schubiger at cpan.org>
+
+ - Merged development version to stable.
+
+0.85_02  2010-04-11  <schubiger at cpan.org>
+
+ - Extract both caller and sub in ::Lang::Base's AUTOLOAD() at once.
+
+ - Correct the indentation of the same subroutine.
+
+0.85_01  2010-04-08  <schubiger at cpan.org>
+
+ - New supported format: <time full> AM/PM. [Wes Morgan]
+
+ - Make _time_full() capable of working with an hours option.
+
+ - Initialize the hours option in _at_time() after having processed
+   the arguments.
 
 0.85  2010-03-13  <schubiger at cpan.org>
 

Modified: branches/upstream/libdatetime-format-natural-perl/current/META.yml
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libdatetime-format-natural-perl/current/META.yml?rev=56586&op=diff
==============================================================================
--- branches/upstream/libdatetime-format-natural-perl/current/META.yml (original)
+++ branches/upstream/libdatetime-format-natural-perl/current/META.yml Tue Apr 20 14:33:54 2010
@@ -1,6 +1,6 @@
 ---
 name: DateTime-Format-Natural
-version: 0.85
+version: 0.86
 author:
   - 'Steven Schubiger <schubiger at cpan.org>'
 abstract: Create machine readable date/time with natural parsing logic
@@ -29,13 +29,13 @@
 provides:
   DateTime::Format::Natural:
     file: lib/DateTime/Format/Natural.pm
-    version: 0.85
+    version: 0.86
   DateTime::Format::Natural::Aliases:
     file: lib/DateTime/Format/Natural/Aliases.pm
     version: 0.03
   DateTime::Format::Natural::Base:
     file: lib/DateTime/Format/Natural/Base.pm
-    version: 1.31
+    version: 1.32
   DateTime::Format::Natural::Compat:
     file: lib/DateTime/Format/Natural/Compat.pm
     version: 0.07
@@ -50,10 +50,10 @@
     version: 0.05
   DateTime::Format::Natural::Lang::Base:
     file: lib/DateTime/Format/Natural/Lang/Base.pm
-    version: 1.05
+    version: 1.06
   DateTime::Format::Natural::Lang::EN:
     file: lib/DateTime/Format/Natural/Lang/EN.pm
-    version: 1.33
+    version: 1.34
   DateTime::Format::Natural::Test:
     file: lib/DateTime/Format/Natural/Test.pm
     version: 0.05

Modified: branches/upstream/libdatetime-format-natural-perl/current/README
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libdatetime-format-natural-perl/current/README?rev=56586&op=diff
==============================================================================
--- branches/upstream/libdatetime-format-natural-perl/current/README (original)
+++ branches/upstream/libdatetime-format-natural-perl/current/README Tue Apr 20 14:33:54 2010
@@ -162,6 +162,7 @@
      Andrew Sterling Hanenkamp
      Eric Wilhelm
      Kevin Field
+     Wes Morgan
 
 SEE ALSO
     DateTime, Date::Calc, http://datetime.perl.org

Modified: branches/upstream/libdatetime-format-natural-perl/current/lib/DateTime/Format/Natural.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libdatetime-format-natural-perl/current/lib/DateTime/Format/Natural.pm?rev=56586&op=diff
==============================================================================
--- branches/upstream/libdatetime-format-natural-perl/current/lib/DateTime/Format/Natural.pm (original)
+++ branches/upstream/libdatetime-format-natural-perl/current/lib/DateTime/Format/Natural.pm Tue Apr 20 14:33:54 2010
@@ -18,7 +18,7 @@
 use Scalar::Util qw(blessed);
 use Storable qw(dclone);
 
-our $VERSION = '0.85';
+our $VERSION = '0.86';
 
 validation_options(
     on_fail => sub
@@ -718,6 +718,7 @@
  Andrew Sterling Hanenkamp
  Eric Wilhelm
  Kevin Field
+ Wes Morgan
 
 =head1 SEE ALSO
 

Modified: branches/upstream/libdatetime-format-natural-perl/current/lib/DateTime/Format/Natural/Base.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libdatetime-format-natural-perl/current/lib/DateTime/Format/Natural/Base.pm?rev=56586&op=diff
==============================================================================
--- branches/upstream/libdatetime-format-natural-perl/current/lib/DateTime/Format/Natural/Base.pm (original)
+++ branches/upstream/libdatetime-format-natural-perl/current/lib/DateTime/Format/Natural/Base.pm Tue Apr 20 14:33:54 2010
@@ -8,7 +8,7 @@
     DateTime::Format::Natural::Wrappers
 );
 
-our $VERSION = '1.31';
+our $VERSION = '1.32';
 
 use constant MORNING   => '08';
 use constant AFTERNOON => '14';
@@ -304,8 +304,8 @@
 {
     my $self = shift;
     my $opts = pop;
+    my ($time) = @_;
     my $hours = $opts->{hours} || 0;
-    my ($time) = @_;
     if ($time =~ /:/) {
         my ($hour, $minute) = split /:/, $time;
         if ($self->_valid_time(hour => $hours + $hour, minute => $minute)) {
@@ -331,10 +331,11 @@
     $self->_register_trace;
     my $opts = pop;
     my ($time) = @_;
+    my $hours = $opts->{hours} || 0;
     my ($hour, $minute, $second) = split /:/, $time;
-    if ($self->_valid_time(hour => $hour, minute => $minute, second => $second)) {
-        $self->_set(
-            hour   => $hour,
+    if ($self->_valid_time(hour => $hours + $hour, minute => $minute, second => $second)) {
+        $self->_set(
+            hour   => $hours + $hour,
             minute => $minute,
             second => $second,
         );

Modified: branches/upstream/libdatetime-format-natural-perl/current/lib/DateTime/Format/Natural/Lang/Base.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libdatetime-format-natural-perl/current/lib/DateTime/Format/Natural/Lang/Base.pm?rev=56586&op=diff
==============================================================================
--- branches/upstream/libdatetime-format-natural-perl/current/lib/DateTime/Format/Natural/Lang/Base.pm (original)
+++ branches/upstream/libdatetime-format-natural-perl/current/lib/DateTime/Format/Natural/Lang/Base.pm Tue Apr 20 14:33:54 2010
@@ -5,7 +5,7 @@
 
 our ($VERSION, $AUTOLOAD);
 
-$VERSION = '1.05';
+$VERSION = '1.06';
 
 sub __new
 {
@@ -32,19 +32,17 @@
 {
     my ($self, $exp) = @_;
 
-    my ($caller) = $AUTOLOAD =~ /(.*)::.*/;
-    my $sub = $AUTOLOAD;
-    $sub =~ s/^.*:://;
+    my ($caller, $sub) = $AUTOLOAD =~ /^(.*)::(.*)$/;
 
     if (substr($sub, 0, 2) eq '__') {
-       $sub =~ s/^__//;
-       no strict 'refs';
-       if (defined $exp && length $exp) {
-           return ${$caller.'::'.$sub}{$exp};
-       }
-       else {
-           return \%{$caller.'::'.$sub};
-       }
+        $sub =~ s/^__//;
+        no strict 'refs';
+        if (defined $exp && length $exp) {
+            return ${$caller.'::'.$sub}{$exp};
+        }
+        else {
+            return \%{$caller.'::'.$sub};
+        }
     }
 }
 

Modified: branches/upstream/libdatetime-format-natural-perl/current/lib/DateTime/Format/Natural/Lang/EN.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libdatetime-format-natural-perl/current/lib/DateTime/Format/Natural/Lang/EN.pm?rev=56586&op=diff
==============================================================================
--- branches/upstream/libdatetime-format-natural-perl/current/lib/DateTime/Format/Natural/Lang/EN.pm (original)
+++ branches/upstream/libdatetime-format-natural-perl/current/lib/DateTime/Format/Natural/Lang/EN.pm Tue Apr 20 14:33:54 2010
@@ -9,7 +9,7 @@
 
 use DateTime::Format::Natural::Helpers qw(%flag);
 
-our $VERSION = '1.33';
+our $VERSION = '1.34';
 
 our (%init,
      %timespan,
@@ -1460,6 +1460,24 @@
            prefer_future => true,
            truncate_to   => 'minute',
          },
+       ],
+       [
+         { 0 => $RE{time_full}, 1 => 'am' },
+         [],
+         [],
+         [ [ 0 ] ],
+         [ {} ],
+         [ '_time_full' ],
+         { prefer_future => true },
+       ],
+       [
+         { 0 => $RE{time_full}, 1 => 'pm' },
+         [],
+         [],
+         [ [ 0 ] ],
+         [ { hours => 12 } ],
+         [ '_time_full' ],
+         { prefer_future => true },
        ],
     ],
     at_combined => [
@@ -3577,6 +3595,8 @@
  8 pm
  4pm
  4:20pm
+ 06:56:06 am
+ 06:56:06 pm
  mon 2:35
  1am sun
  1pm sun

Modified: branches/upstream/libdatetime-format-natural-perl/current/t/01-parse.t
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libdatetime-format-natural-perl/current/t/01-parse.t?rev=56586&op=diff
==============================================================================
--- branches/upstream/libdatetime-format-natural-perl/current/t/01-parse.t (original)
+++ branches/upstream/libdatetime-format-natural-perl/current/t/01-parse.t Tue Apr 20 14:33:54 2010
@@ -125,6 +125,8 @@
     { '8 pm'                  => '24.11.2006 20:00:00' },
     { '4pm'                   => '24.11.2006 16:00:00' },
     { '4:20pm'                => '24.11.2006 16:20:00' },
+    { '06:56:06 am'           => '24.11.2006 06:56:06' },
+    { '06:56:06 pm'           => '24.11.2006 18:56:06' },
     { 'mon 2:35'              => '20.11.2006 02:35:00' },
     { '1am sun'               => '26.11.2006 01:00:00' },
     { '1pm sun'               => '26.11.2006 13:00:00' },
@@ -249,7 +251,7 @@
     { '+2d'               => '26.11.2006 01:13:08' },
 );
 
-_run_tests(232, [ [ \@simple ], [ \@complex ], [ \@specific ] ], \&compare);
+_run_tests(234, [ [ \@simple ], [ \@complex ], [ \@specific ] ], \&compare);
 
 sub compare
 {

Modified: branches/upstream/libdatetime-format-natural-perl/current/t/02-parse_format.t
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libdatetime-format-natural-perl/current/t/02-parse_format.t?rev=56586&op=diff
==============================================================================
--- branches/upstream/libdatetime-format-natural-perl/current/t/02-parse_format.t (original)
+++ branches/upstream/libdatetime-format-natural-perl/current/t/02-parse_format.t Tue Apr 20 14:33:54 2010
@@ -8,18 +8,20 @@
 use Test::More;
 
 my @specific = (
-    { '27/5/1979'           => [ '27.05.1979 00:00:00', 'dd/m/yyyy'  ] },
-    { '5/27/1979'           => [ '27.05.1979 00:00:00', 'mm/d/yyyy'  ] },
-    { '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        ] },
+    { '27/5/1979'              => [ '27.05.1979 00:00:00', 'dd/m/yyyy'  ] },
+    { '5/27/1979'              => [ '27.05.1979 00:00:00', 'mm/d/yyyy'  ] },
+    { '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        ] },
+    { '12/03/2008 06:56:06 am' => [ '12.03.2008 06:56:06', undef        ] },
+    { '12/03/2008 06:56:06 pm' => [ '12.03.2008 18:56:06', undef        ] },
 );
 
-_run_tests(9, [ [ \@specific ] ], \&compare);
+_run_tests(11, [ [ \@specific ] ], \&compare);
 
 sub compare
 {

Modified: branches/upstream/libdatetime-format-natural-perl/current/t/06-parse_prefer_future.t
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libdatetime-format-natural-perl/current/t/06-parse_prefer_future.t?rev=56586&op=diff
==============================================================================
--- branches/upstream/libdatetime-format-natural-perl/current/t/06-parse_prefer_future.t (original)
+++ branches/upstream/libdatetime-format-natural-perl/current/t/06-parse_prefer_future.t Tue Apr 20 14:33:54 2010
@@ -34,6 +34,8 @@
     { '8 pm'         => '24.11.2006 20:00:00' },
     { '4pm'          => '24.11.2006 16:00:00' },
     { '4:20pm'       => '24.11.2006 16:20:00' },
+    { '00:56:06 am'  => '25.11.2006 00:56:06' },
+    { '00:56:06 pm'  => '24.11.2006 12:56:06' },
 );
 
 my @combined = (
@@ -58,7 +60,7 @@
     { '12/24' => '24.12.2006 00:00:00' },
 );
 
-_run_tests(32, [ [ \@simple ], [ \@combined ], [ \@formatted ] ], \&compare);
+_run_tests(34, [ [ \@simple ], [ \@combined ], [ \@formatted ] ], \&compare);
 
 sub compare
 {




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