r56221 - in /trunk/libdatetime-format-dateparse-perl: Changes META.yml Makefile.PL README debian/changelog lib/DateTime/Format/DateParse.pm t/02_date.t
gregoa at users.alioth.debian.org
gregoa at users.alioth.debian.org
Fri Apr 16 20:00:55 UTC 2010
Author: gregoa
Date: Fri Apr 16 20:00:42 2010
New Revision: 56221
URL: http://svn.debian.org/wsvn/pkg-perl/?sc=1&rev=56221
Log:
New upstream release.
Modified:
trunk/libdatetime-format-dateparse-perl/Changes
trunk/libdatetime-format-dateparse-perl/META.yml
trunk/libdatetime-format-dateparse-perl/Makefile.PL
trunk/libdatetime-format-dateparse-perl/README
trunk/libdatetime-format-dateparse-perl/debian/changelog
trunk/libdatetime-format-dateparse-perl/lib/DateTime/Format/DateParse.pm
trunk/libdatetime-format-dateparse-perl/t/02_date.t
Modified: trunk/libdatetime-format-dateparse-perl/Changes
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libdatetime-format-dateparse-perl/Changes?rev=56221&op=diff
==============================================================================
--- trunk/libdatetime-format-dateparse-perl/Changes (original)
+++ trunk/libdatetime-format-dateparse-perl/Changes Fri Apr 16 20:00:42 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: trunk/libdatetime-format-dateparse-perl/META.yml
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libdatetime-format-dateparse-perl/META.yml?rev=56221&op=diff
==============================================================================
--- trunk/libdatetime-format-dateparse-perl/META.yml (original)
+++ trunk/libdatetime-format-dateparse-perl/META.yml Fri Apr 16 20:00:42 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: trunk/libdatetime-format-dateparse-perl/Makefile.PL
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libdatetime-format-dateparse-perl/Makefile.PL?rev=56221&op=diff
==============================================================================
--- trunk/libdatetime-format-dateparse-perl/Makefile.PL (original)
+++ trunk/libdatetime-format-dateparse-perl/Makefile.PL Fri Apr 16 20:00:42 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: trunk/libdatetime-format-dateparse-perl/README
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libdatetime-format-dateparse-perl/README?rev=56221&op=diff
==============================================================================
--- trunk/libdatetime-format-dateparse-perl/README (original)
+++ trunk/libdatetime-format-dateparse-perl/README Fri Apr 16 20:00:42 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: trunk/libdatetime-format-dateparse-perl/debian/changelog
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libdatetime-format-dateparse-perl/debian/changelog?rev=56221&op=diff
==============================================================================
--- trunk/libdatetime-format-dateparse-perl/debian/changelog (original)
+++ trunk/libdatetime-format-dateparse-perl/debian/changelog Fri Apr 16 20:00:42 2010
@@ -1,3 +1,9 @@
+libdatetime-format-dateparse-perl (0.05-1) UNRELEASED; urgency=low
+
+ * New upstream release.
+
+ -- gregor herrmann <gregoa at debian.org> Fri, 16 Apr 2010 21:59:46 +0200
+
libdatetime-format-dateparse-perl (0.04-2) unstable; urgency=low
[ Nathan Handler ]
Modified: trunk/libdatetime-format-dateparse-perl/lib/DateTime/Format/DateParse.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libdatetime-format-dateparse-perl/lib/DateTime/Format/DateParse.pm?rev=56221&op=diff
==============================================================================
--- trunk/libdatetime-format-dateparse-perl/lib/DateTime/Format/DateParse.pm (original)
+++ trunk/libdatetime-format-dateparse-perl/lib/DateTime/Format/DateParse.pm Fri Apr 16 20:00:42 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: trunk/libdatetime-format-dateparse-perl/t/02_date.t
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libdatetime-format-dateparse-perl/t/02_date.t?rev=56221&op=diff
==============================================================================
--- trunk/libdatetime-format-dateparse-perl/t/02_date.t (original)
+++ trunk/libdatetime-format-dateparse-perl/t/02_date.t Fri Apr 16 20:00:42 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