r56219 - in /branches/upstream/libdatetime-format-dateparse-perl/current: Changes META.yml Makefile.PL README lib/DateTime/Format/DateParse.pm t/02_date.t

gregoa at users.alioth.debian.org gregoa at users.alioth.debian.org
Fri Apr 16 19:59:23 UTC 2010


Author: gregoa
Date: Fri Apr 16 19:59:18 2010
New Revision: 56219

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

Modified:
    branches/upstream/libdatetime-format-dateparse-perl/current/Changes
    branches/upstream/libdatetime-format-dateparse-perl/current/META.yml
    branches/upstream/libdatetime-format-dateparse-perl/current/Makefile.PL
    branches/upstream/libdatetime-format-dateparse-perl/current/README
    branches/upstream/libdatetime-format-dateparse-perl/current/lib/DateTime/Format/DateParse.pm
    branches/upstream/libdatetime-format-dateparse-perl/current/t/02_date.t

Modified: branches/upstream/libdatetime-format-dateparse-perl/current/Changes
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libdatetime-format-dateparse-perl/current/Changes?rev=56219&op=diff
==============================================================================
--- branches/upstream/libdatetime-format-dateparse-perl/current/Changes (original)
+++ branches/upstream/libdatetime-format-dateparse-perl/current/Changes Fri Apr 16 19:59:18 2010
@@ -1,4 +1,9 @@
 Revision history for Perl module DateTime::Format::DateParse
+
+0.05
+    - test warning fix
+    - Nanoseconds are always turned into an integer, with rounding as
+      needed. (Dave Rolsky)
 
 0.04 Sun Sep 17 13:10:19 HST 2006
     - fix a bug in Build.pl

Modified: branches/upstream/libdatetime-format-dateparse-perl/current/META.yml
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libdatetime-format-dateparse-perl/current/META.yml?rev=56219&op=diff
==============================================================================
--- branches/upstream/libdatetime-format-dateparse-perl/current/META.yml (original)
+++ branches/upstream/libdatetime-format-dateparse-perl/current/META.yml Fri Apr 16 19:59:18 2010
@@ -1,22 +1,24 @@
 ---
-name: DateTime-Format-DateParse
-version: 0.04
+abstract: 'Parses Date::Parse compatible formats'
 author:
   - 'Joshua Hoblitt (JHOBLITT) <jhoblitt at cpan.org>'
-abstract: Parses Date::Parse compatible formats
+configure_requires:
+  Module::Build: 0.36
+generated_by: 'Module::Build version 0.3601'
 license: perl
-resources:
-  license: http://dev.perl.org/licenses/
+meta-spec:
+  url: http://module-build.sourceforge.net/META-spec-v1.4.html
+  version: 1.4
+name: DateTime-Format-DateParse
+provides:
+  DateTime::Format::DateParse:
+    file: lib/DateTime/Format/DateParse.pm
+    version: 0.05
 requires:
   Date::Parse: 2.27
   DateTime: 0.29
   DateTime::TimeZone: 0.27
   Time::Zone: 2.22
-provides:
-  DateTime::Format::DateParse:
-    file: lib/DateTime/Format/DateParse.pm
-    version: 0.04
-generated_by: Module::Build version 0.28
-meta-spec:
-  url: http://module-build.sourceforge.net/META-spec-v1.2.html
-  version: 1.2
+resources:
+  license: http://dev.perl.org/licenses/
+version: 0.05

Modified: branches/upstream/libdatetime-format-dateparse-perl/current/Makefile.PL
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libdatetime-format-dateparse-perl/current/Makefile.PL?rev=56219&op=diff
==============================================================================
--- branches/upstream/libdatetime-format-dateparse-perl/current/Makefile.PL (original)
+++ branches/upstream/libdatetime-format-dateparse-perl/current/Makefile.PL Fri Apr 16 19:59:18 2010
@@ -1,31 +1,34 @@
-# Note: this file was auto-generated by Module::Build::Compat version 0.03
-    
+# Note: this file was auto-generated by Module::Build::Compat version 0.3601
+
     unless (eval "use Module::Build::Compat 0.02; 1" ) {
       print "This module requires Module::Build to install itself.\n";
-      
+
       require ExtUtils::MakeMaker;
       my $yn = ExtUtils::MakeMaker::prompt
 	('  Install Module::Build now from CPAN?', 'y');
-      
+
       unless ($yn =~ /^y/i) {
 	die " *** Cannot install without Module::Build.  Exiting ...\n";
       }
-      
+
       require Cwd;
       require File::Spec;
       require CPAN;
-      
+
       # Save this 'cause CPAN will chdir all over the place.
       my $cwd = Cwd::cwd();
-      
+
       CPAN::Shell->install('Module::Build::Compat');
       CPAN::Shell->expand("Module", "Module::Build::Compat")->uptodate
 	or die "Couldn't install Module::Build, giving up.\n";
-      
+
       chdir $cwd or die "Cannot chdir() back to $cwd: $!";
     }
     eval "use Module::Build::Compat 0.02; 1" or die $@;
     
     Module::Build::Compat->run_build_pl(args => \@ARGV);
+    my $build_script = 'Build';
+    $build_script .= '.com' if $^O eq 'VMS';
+    exit(0) unless(-e $build_script); # cpantesters convention
     require Module::Build;
     Module::Build::Compat->write_makefile(build_class => 'Module::Build');

Modified: branches/upstream/libdatetime-format-dateparse-perl/current/README
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libdatetime-format-dateparse-perl/current/README?rev=56219&op=diff
==============================================================================
--- branches/upstream/libdatetime-format-dateparse-perl/current/README (original)
+++ branches/upstream/libdatetime-format-dateparse-perl/current/README Fri Apr 16 19:59:18 2010
@@ -17,26 +17,28 @@
 
   Methods
    Class Methods
-    * parse_datetime($date [, $zone])
+    *   parse_datetime($date [, $zone])
+
         Accepts a Date::Parse compatible $date string and optionally a
         Time::Zone compatible $zone string.
 
         Returns a DateTime object.
 
 GOTCHAS
-    * If parse_datetime is called on a $date that doesn't know specify a
-    timezone and $zone is not set, then the timezone of the returned
-    DateTime object will be set to the "local" timezone. This is consistent
-    with the behavior of Date::Parse.
-    * If parse_datetime is called without a $zone but the $date string
-    *does* specify a timezone/offset or if parse_datetime is called with a
-    $zone that DateTime::TimeZone does not understand, the returned DateTime
-    object will have it's timezone set to a fixed offset from UTC. This
-    means that "DST" information is not available and date math will not
-    reflect "DST" transitions. This may be resolved for true timezones by
-    using the DateTime::TimeZone::Alias module to "alias" the Time::Zone
-    timezone to an Olson DB name. This may be done automatically in a future
-    release.
+    *   If parse_datetime is called on a $date that doesn't know specify a
+        timezone and $zone is not set, then the timezone of the returned
+        DateTime object will be set to the "local" timezone. This is
+        consistent with the behavior of Date::Parse.
+
+    *   If parse_datetime is called without a $zone but the $date string
+        *does* specify a timezone/offset or if parse_datetime is called with
+        a $zone that DateTime::TimeZone does not understand, the returned
+        DateTime object will have it's timezone set to a fixed offset from
+        UTC. This means that "DST" information is not available and date
+        math will not reflect "DST" transitions. This may be resolved for
+        true timezones by using the DateTime::TimeZone::Alias module to
+        "alias" the Time::Zone timezone to an Olson DB name. This may be
+        done automatically in a future release.
 
 CREDITS
     Graham Barr (GBARR) <gbarr at pobox.com>, author of Date::Parse

Modified: branches/upstream/libdatetime-format-dateparse-perl/current/lib/DateTime/Format/DateParse.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libdatetime-format-dateparse-perl/current/lib/DateTime/Format/DateParse.pm?rev=56219&op=diff
==============================================================================
--- branches/upstream/libdatetime-format-dateparse-perl/current/lib/DateTime/Format/DateParse.pm (original)
+++ branches/upstream/libdatetime-format-dateparse-perl/current/lib/DateTime/Format/DateParse.pm Fri Apr 16 19:59:18 2010
@@ -2,12 +2,12 @@
 
 # Copyright (C) 2005-6  Joshua Hoblitt
 #
-# $Id: DateParse.pm 3517 2006-09-17 23:10:10Z jhoblitt $
+# $Id: DateParse.pm 4429 2010-04-10 19:14:33Z jhoblitt $
 
 use strict;
 
 use vars qw($VERSION);
-$VERSION = '0.04';
+$VERSION = '0.05';
 
 use DateTime;
 use DateTime::TimeZone;
@@ -31,7 +31,13 @@
     my %p;
     if ( $ss ) {
         my $fraction = $ss - int( $ss );
-        $p{ nanosecond } = $fraction * 1e9 if $fraction;
+        if ($fraction) {
+            my $nano = $fraction * 1e9;
+            if ( $nano != int( $nano ) ) {
+                $nano++ if $nano - int( $nano ) >= 0.5;
+            }
+            $p{ nanosecond } = int( $nano );
+        }
         $p{ second } = int $ss;
     }
     $p{ minute }    = $mm if $mm;

Modified: branches/upstream/libdatetime-format-dateparse-perl/current/t/02_date.t
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libdatetime-format-dateparse-perl/current/t/02_date.t?rev=56219&op=diff
==============================================================================
--- branches/upstream/libdatetime-format-dateparse-perl/current/t/02_date.t (original)
+++ branches/upstream/libdatetime-format-dateparse-perl/current/t/02_date.t Fri Apr 16 19:59:18 2010
@@ -138,9 +138,20 @@
 
 my @data = split(/\n/, $data);
 
-plan tests => scalar @data;
+plan tests => scalar @data + 2;
 
 foreach my $format (@data) {
     my $dt = DateTime::Format::DateParse->parse_datetime($format);
     isa_ok($dt, 'DateTime');
 }
+
+{
+    my $dt = DateTime::Format::DateParse->parse_datetime('1995-01-24T09:08:17.1823213');
+    is( $dt->nanosecond, 182_321_300, 'nanosecond is an integer' );
+}
+
+{
+    my $dt = DateTime::Format::DateParse->parse_datetime('1995-01-24T09:08:17.6666666666');
+    is( $dt->nanosecond, 666_666_667, 'nanosecond is rounded properly' );
+}
+




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