r62181 - in /branches/upstream/libdatetime-format-flexible-perl/current: Changes META.yml Makefile.PL lib/DateTime/Format/Flexible.pm t/base.t

ansgar-guest at users.alioth.debian.org ansgar-guest at users.alioth.debian.org
Sun Aug 29 11:16:41 UTC 2010


Author: ansgar-guest
Date: Sun Aug 29 11:15:14 2010
New Revision: 62181

URL: http://svn.debian.org/wsvn/pkg-perl/?sc=1&rev=62181
Log:
[svn-upgrade] new version libdatetime-format-flexible-perl (0.16)

Modified:
    branches/upstream/libdatetime-format-flexible-perl/current/Changes
    branches/upstream/libdatetime-format-flexible-perl/current/META.yml
    branches/upstream/libdatetime-format-flexible-perl/current/Makefile.PL
    branches/upstream/libdatetime-format-flexible-perl/current/lib/DateTime/Format/Flexible.pm
    branches/upstream/libdatetime-format-flexible-perl/current/t/base.t

Modified: branches/upstream/libdatetime-format-flexible-perl/current/Changes
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libdatetime-format-flexible-perl/current/Changes?rev=62181&op=diff
==============================================================================
--- branches/upstream/libdatetime-format-flexible-perl/current/Changes (original)
+++ branches/upstream/libdatetime-format-flexible-perl/current/Changes Sun Aug 29 11:15:14 2010
@@ -1,4 +1,7 @@
 Revision history for Perl module DateTime::Format::Flexible
+
+0.16 Thu Aug 25 2010
+   - make sure 'now' means now and not when the module loaded unless user has set a base (thanks Ryan Voots rt #60731)
 
 0.15 Mon Mar 10 2010
    - fix tests for DateTime string overloading problem (thanks Andreas Koenig and Michael Schwern)

Modified: branches/upstream/libdatetime-format-flexible-perl/current/META.yml
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libdatetime-format-flexible-perl/current/META.yml?rev=62181&op=diff
==============================================================================
--- branches/upstream/libdatetime-format-flexible-perl/current/META.yml (original)
+++ branches/upstream/libdatetime-format-flexible-perl/current/META.yml Sun Aug 29 11:15:14 2010
@@ -1,19 +1,28 @@
 --- #YAML:1.0
-name:                DateTime-Format-Flexible
-version:             0.15
-abstract:            DateTime::Format::Flexible - Flexibly parse strings and turn them into DateTime objects.
-license:             perl
-author:              
+name:               DateTime-Format-Flexible
+version:            0.16
+abstract:           DateTime::Format::Flexible - Flexibly parse strings and turn them into DateTime objects.
+author:
     - Tom Heady (cpan at punch.net)
-generated_by:        ExtUtils::MakeMaker version 6.42
-distribution_type:   module
-requires:     
-    DateTime:                      0
-    DateTime::Format::Builder:     0.74
-    DateTime::TimeZone:            0
-    List::MoreUtils:               0
-    Module::Pluggable:             0
-    Test::Simple:                  0.44
+license:            perl
+distribution_type:  module
+configure_requires:
+    ExtUtils::MakeMaker:  0
+build_requires:
+    ExtUtils::MakeMaker:  0
+requires:
+    DateTime:             0
+    DateTime::Format::Builder:  0.74
+    DateTime::TimeZone:   0
+    List::MoreUtils:      0
+    Module::Pluggable:    0
+    Test::MockTime:       0
+    Test::Simple:         0.44
+no_index:
+    directory:
+        - t
+        - inc
+generated_by:       ExtUtils::MakeMaker version 6.55_02
 meta-spec:
-    url:     http://module-build.sourceforge.net/META-spec-v1.3.html
-    version: 1.3
+    url:      http://module-build.sourceforge.net/META-spec-v1.4.html
+    version:  1.4

Modified: branches/upstream/libdatetime-format-flexible-perl/current/Makefile.PL
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libdatetime-format-flexible-perl/current/Makefile.PL?rev=62181&op=diff
==============================================================================
--- branches/upstream/libdatetime-format-flexible-perl/current/Makefile.PL (original)
+++ branches/upstream/libdatetime-format-flexible-perl/current/Makefile.PL Sun Aug 29 11:15:14 2010
@@ -10,6 +10,7 @@
     ABSTRACT     => 'DateTime::Format::Flexible - Flexibly parse strings and turn them into DateTime objects.',
     PREREQ_PM    => {
         'Test::Simple'              => 0.44, # <-- auto added for tests
+        'Test::MockTime'            => 0,
         'DateTime::Format::Builder' => 0.74, # length parameter can now be an arrayref
         'DateTime'                  => 0,
         'DateTime::TimeZone'        => 0,

Modified: branches/upstream/libdatetime-format-flexible-perl/current/lib/DateTime/Format/Flexible.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libdatetime-format-flexible-perl/current/lib/DateTime/Format/Flexible.pm?rev=62181&op=diff
==============================================================================
--- branches/upstream/libdatetime-format-flexible-perl/current/lib/DateTime/Format/Flexible.pm (original)
+++ branches/upstream/libdatetime-format-flexible-perl/current/lib/DateTime/Format/Flexible.pm Sun Aug 29 11:15:14 2010
@@ -2,7 +2,7 @@
 use strict;
 use warnings;
 
-our $VERSION = '0.15';
+our $VERSION = '0.16';
 
 use base 'DateTime::Format::Builder';
 
@@ -76,12 +76,13 @@
 use DateTime::TimeZone;
 use DateTime::Format::Builder 0.74;
 
-my $base_dt = DateTime->now;
+my $base_dt;
+
 sub base
 {
     my ( $self , $dt ) = @_;
     $base_dt = $dt if ( $dt );
-    return $base_dt;
+    return $base_dt || DateTime->now;
 }
 
 my $formats =

Modified: branches/upstream/libdatetime-format-flexible-perl/current/t/base.t
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libdatetime-format-flexible-perl/current/t/base.t?rev=62181&op=diff
==============================================================================
--- branches/upstream/libdatetime-format-flexible-perl/current/t/base.t (original)
+++ branches/upstream/libdatetime-format-flexible-perl/current/t/base.t Sun Aug 29 11:15:14 2010
@@ -3,13 +3,26 @@
 use strict;
 use warnings;
 
-use Test::More tests => 2;
+use Test::More tests => 3;
+use Test::MockTime ();
 
 use DateTime::Format::Flexible;
 my $base = 'DateTime::Format::Flexible';
 
 # my ( $base_dt ) = $base->parse_datetime( '2005-06-07T13:14:15' );
 # $base->base( $base_dt );
+
+
+{
+    my $dt  = DateTime::Format::Flexible->parse_datetime( 'now' );
+    Test::MockTime::set_relative_time( 120 );
+    my $dt2 = DateTime::Format::Flexible->parse_datetime( 'now' );
+
+    isnt( $dt->datetime, $dt2->datetime, 'parsing now is not always the same as module load' );
+
+    diag( $dt->datetime .' => '. $dt2->datetime );
+}
+
 
 my $base_dt = DateTime->new( year => 2009, month => 6, day => 22 );
 




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