r59466 - in /trunk/libdatetime-format-natural-perl: ./ debian/ lib/DateTime/Format/ lib/DateTime/Format/Natural/ lib/DateTime/Format/Natural/Lang/ scripts/ t/
carnil-guest at users.alioth.debian.org
carnil-guest at users.alioth.debian.org
Thu Jun 17 05:26:25 UTC 2010
Author: carnil-guest
Date: Thu Jun 17 05:25:59 2010
New Revision: 59466
URL: http://svn.debian.org/wsvn/pkg-perl/?sc=1&rev=59466
Log:
New upstream release
Added:
trunk/libdatetime-format-natural-perl/lib/DateTime/Format/Natural/Calc.pm
- copied unchanged from r59465, branches/upstream/libdatetime-format-natural-perl/current/lib/DateTime/Format/Natural/Calc.pm
trunk/libdatetime-format-natural-perl/t/10-parse_assert.t
- copied unchanged from r59465, branches/upstream/libdatetime-format-natural-perl/current/t/10-parse_assert.t
trunk/libdatetime-format-natural-perl/t/11-regression.t
- copied unchanged from r59465, branches/upstream/libdatetime-format-natural-perl/current/t/11-regression.t
trunk/libdatetime-format-natural-perl/t/12-state.t
- copied unchanged from r59465, branches/upstream/libdatetime-format-natural-perl/current/t/12-state.t
trunk/libdatetime-format-natural-perl/t/13-trace.t
- copied unchanged from r59465, branches/upstream/libdatetime-format-natural-perl/current/t/13-trace.t
Removed:
trunk/libdatetime-format-natural-perl/lib/DateTime/Format/Natural/Base.pm
trunk/libdatetime-format-natural-perl/t/10-regression.t
trunk/libdatetime-format-natural-perl/t/11-state.t
trunk/libdatetime-format-natural-perl/t/12-trace.t
Modified:
trunk/libdatetime-format-natural-perl/Changes
trunk/libdatetime-format-natural-perl/MANIFEST
trunk/libdatetime-format-natural-perl/META.yml
trunk/libdatetime-format-natural-perl/debian/changelog
trunk/libdatetime-format-natural-perl/lib/DateTime/Format/Natural.pm
trunk/libdatetime-format-natural-perl/lib/DateTime/Format/Natural/Lang/EN.pm
trunk/libdatetime-format-natural-perl/scripts/dateparse
trunk/libdatetime-format-natural-perl/t/00-load.t
Modified: trunk/libdatetime-format-natural-perl/Changes
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libdatetime-format-natural-perl/Changes?rev=59466&op=diff
==============================================================================
--- trunk/libdatetime-format-natural-perl/Changes (original)
+++ trunk/libdatetime-format-natural-perl/Changes Thu Jun 17 05:25:59 2010
@@ -1,4 +1,40 @@
Revision history for Perl extension DateTime::Format::Natural.
+
+0.88 2010-06-16 <schubiger at cpan.org>
+
+ - Merged development version to stable.
+
+0.87_03 2010-06-12 <schubiger at cpan.org>
+
+ - Fix broken use_ok() test for the Calc module.
+
+ - Insert some missing examples in the grammar documentation.
+
+0.87_02 2010-06-09 <schubiger at cpan.org>
+
+ - Strengthen the check for invalid units of prefixed dates.
+
+ - Add a test file for parse asserts.
+
+ - Rename Base.pm to Calc.pm and adjust trace tests.
+
+ - Reword the according abstract and description.
+
+ - Document where arguments to dateparse's switches are required.
+
+ - Allow dateparse to handle the language code in uppercase.
+
+0.87_01 2010-06-06 <schubiger at cpan.org>
+
+ - Match case-insensitively in the language option check.
+
+ - Require (and not use) the grammar class in runtime eval.
+
+ - Purge the remains of the formatted instance data member.
+
+ - Delete some instance data through hash slices.
+
+ - Convert a few non-option identifiers to lowercase.
0.87 2010-05-29 <schubiger at cpan.org>
Modified: trunk/libdatetime-format-natural-perl/MANIFEST
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libdatetime-format-natural-perl/MANIFEST?rev=59466&op=diff
==============================================================================
--- trunk/libdatetime-format-natural-perl/MANIFEST (original)
+++ trunk/libdatetime-format-natural-perl/MANIFEST Thu Jun 17 05:25:59 2010
@@ -3,7 +3,7 @@
INSTALL
lib/DateTime/Format/Natural.pm
lib/DateTime/Format/Natural/Aliases.pm
-lib/DateTime/Format/Natural/Base.pm
+lib/DateTime/Format/Natural/Calc.pm
lib/DateTime/Format/Natural/Compat.pm
lib/DateTime/Format/Natural/Duration.pm
lib/DateTime/Format/Natural/Formatted.pm
@@ -28,8 +28,9 @@
t/07-parse_datetime.t
t/08-parse_failure.t
t/09-parse_aliases.t
-t/10-regression.t
-t/11-state.t
-t/12-trace.t
+t/10-parse_assert.t
+t/11-regression.t
+t/12-state.t
+t/13-trace.t
t/pod-coverage.t
t/pod.t
Modified: trunk/libdatetime-format-natural-perl/META.yml
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libdatetime-format-natural-perl/META.yml?rev=59466&op=diff
==============================================================================
--- trunk/libdatetime-format-natural-perl/META.yml (original)
+++ trunk/libdatetime-format-natural-perl/META.yml Thu Jun 17 05:25:59 2010
@@ -1,6 +1,6 @@
---
name: DateTime-Format-Natural
-version: 0.87
+version: 0.88
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.87
+ version: 0.88
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.33
+ DateTime::Format::Natural::Calc:
+ file: lib/DateTime/Format/Natural/Calc.pm
+ version: 1.34
DateTime::Format::Natural::Compat:
file: lib/DateTime/Format/Natural/Compat.pm
version: 0.07
@@ -53,7 +53,7 @@
version: 1.06
DateTime::Format::Natural::Lang::EN:
file: lib/DateTime/Format/Natural/Lang/EN.pm
- version: 1.36
+ version: 1.37
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=59466&op=diff
==============================================================================
--- trunk/libdatetime-format-natural-perl/debian/changelog (original)
+++ trunk/libdatetime-format-natural-perl/debian/changelog Thu Jun 17 05:25:59 2010
@@ -1,3 +1,9 @@
+libdatetime-format-natural-perl (0.88-1) UNRELEASED; urgency=low
+
+ * New upstream release
+
+ -- Salvatore Bonaccorso <salvatore.bonaccorso at gmail.com> Thu, 17 Jun 2010 07:21:10 +0200
+
libdatetime-format-natural-perl (0.87-1) unstable; urgency=low
* New upstream release
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=59466&op=diff
==============================================================================
--- trunk/libdatetime-format-natural-perl/lib/DateTime/Format/Natural.pm (original)
+++ trunk/libdatetime-format-natural-perl/lib/DateTime/Format/Natural.pm Thu Jun 17 05:25:59 2010
@@ -4,7 +4,7 @@
use warnings;
use base qw(
DateTime::Format::Natural::Aliases
- DateTime::Format::Natural::Base
+ DateTime::Format::Natural::Calc
DateTime::Format::Natural::Duration
DateTime::Format::Natural::Formatted
DateTime::Format::Natural::Helpers
@@ -18,7 +18,7 @@
use Scalar::Util qw(blessed);
use Storable qw(dclone);
-our $VERSION = '0.87';
+our $VERSION = '0.88';
validation_options(
on_fail => sub
@@ -64,7 +64,7 @@
$self->{Daytime} = $opts{daytime} || {};
my $mod = __PACKAGE__.'::Lang::'.uc($self->{Lang});
- eval "use $mod"; die $@ if $@;
+ eval "require $mod"; die $@ if $@;
$self->{data} = $mod->__new();
$self->{grammar_class} = $mod;
@@ -78,7 +78,7 @@
lang => {
type => SCALAR,
optional => true,
- regex => qr!^(?:en)$!,
+ regex => qr!^(?:en)$!i,
},
format => {
type => SCALAR,
@@ -123,9 +123,7 @@
{
my $self = shift;
- foreach my $member (qw(modified postprocess)) {
- delete $self->{$member};
- }
+ delete @$self{qw(modified postprocess)};
}
sub parse_datetime
@@ -134,9 +132,9 @@
$self->_parse_init(@_);
- $self->{Input_string} = $self->{Date_string};
-
- my $date_string = $self->{Date_string};
+ $self->{input_string} = $self->{date_string};
+
+ my $date_string = $self->{date_string};
$self->_rewrite_aliases(\$date_string);
$date_string =~ tr/,//d;
@@ -173,7 +171,7 @@
);
my $method = $methods{$prefix};
- if (none { $unit =~ /${_}s?/ } @{$self->{data}->__units('ordered')}) {
+ if (none { $unit =~ /^${_}s?$/ } @{$self->{data}->__units('ordered')}) {
$self->_set_failure;
$self->_set_error("(invalid unit)");
return $self->_get_datetime_object;
@@ -220,7 +218,7 @@
{
my $self = shift;
- $self->_params_init(@_, { string => \$self->{Date_string} });
+ $self->_params_init(@_, { string => \$self->{date_string} });
my $set_datetime = sub
{
@@ -285,12 +283,10 @@
$self->_post_duration(\@queue);
$self->_restore_state;
- foreach my $member (qw(duration formatted insert state)) {
- delete $self->{$member};
- }
+ delete @$self{qw(duration insert state)};
@{$self->{traces}} = @traces;
- $self->{Input_string} = $duration_string;
+ $self->{input_string} = $duration_string;
return @queue;
}
@@ -308,7 +304,7 @@
return '' if $self->success;
- my $error = "'$self->{Input_string}' does not parse ";
+ my $error = "'$self->{input_string}' does not parse ";
$error .= $self->_get_error || '(perhaps you have some garbage?)';
return $error;
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=59466&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 Thu Jun 17 05:25:59 2010
@@ -9,7 +9,7 @@
use DateTime::Format::Natural::Helpers qw(%flag);
-our $VERSION = '1.36';
+our $VERSION = '1.37';
our (%init,
%timespan,
@@ -3906,6 +3906,9 @@
tomorrow morning
tomorrow afternoon
tomorrow evening
+ 6:00 yesterday
+ 6:00 today
+ 6:00 tomorrow
5am yesterday
5am today
5am tomorrow
@@ -3961,6 +3964,9 @@
yesterday at 4:00
today at 4:00
tomorrow at 4:00
+ yesterday at 6:45am
+ today at 6:45am
+ tomorrow at 6:45am
yesterday at 6:45pm
today at 6:45pm
tomorrow at 6:45pm
@@ -3970,6 +3976,9 @@
yesterday at 2:32 PM
today at 2:32 PM
tomorrow at 2:32 PM
+ yesterday 02:32
+ today 02:32
+ tomorrow 02:32
yesterday 2:32am
today 2:32am
tomorrow 2:32am
@@ -3977,8 +3986,10 @@
today 2:32pm
tomorrow 2:32pm
wednesday at 14:30
+ wednesday at 02:30am
wednesday at 02:30pm
wednesday 14:30
+ wednesday 02:30am
wednesday 02:30pm
friday 03:00 am
friday 03:00 pm
@@ -3999,10 +4010,14 @@
06:56:06 am
06:56:06 pm
mon 2:35
+ 1:00 sun
1am sun
1pm sun
+ 1:00 on sun
1am on sun
1pm on sun
+ 12:14 PM
+ 12:14 AM
=head2 Complex
@@ -4074,6 +4089,9 @@
last friday at 20:00
this friday at 20:00
next friday at 20:00
+ 1:00 last friday
+ 1:00 this friday
+ 1:00 next friday
1am last friday
1am this friday
1am next friday
@@ -4086,6 +4104,8 @@
2nd friday in august
3rd wednesday in november
tomorrow 1 year ago
+ saturday 3 months ago at 17:00
+ saturday 3 months ago at 5:00am
saturday 3 months ago at 5:00pm
11 january 2 years ago
4th day last week
@@ -4100,7 +4120,7 @@
=head2 Timespans
- Monday to Friday
+ monday to friday
1 April to 31 August
1999-12-31 to tomorrow
now to 2010-01-01
@@ -4123,9 +4143,10 @@
=head2 Specific
march
- January 11
- 11 January
+ january 11
+ 11 january
dec 25
+ feb 28 3:00
feb 28 3am
feb 28 3pm
may 27th
Modified: trunk/libdatetime-format-natural-perl/scripts/dateparse
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libdatetime-format-natural-perl/scripts/dateparse?rev=59466&op=diff
==============================================================================
--- trunk/libdatetime-format-natural-perl/scripts/dateparse (original)
+++ trunk/libdatetime-format-natural-perl/scripts/dateparse Thu Jun 17 05:25:59 2010
@@ -67,14 +67,14 @@
{
print <<USAGE;
Usage: $0 [switches]
- -f, --format format of numeric dates
- -h, --help this help screen
- -l, --lang language code
- -p, --prefer_future use future dates (when possible)
- -s, --supported list of supported languages
- -t, --time_zone time zone string
- -T, --trace print trace after processing
- -V, --version print version
+ -f, --format=<format> format of numeric dates
+ -h, --help this help screen
+ -l, --lang=<code> language code
+ -p, --prefer_future use future dates (when possible)
+ -s, --supported list of supported languages
+ -t, --time_zone=<string> time zone string
+ -T, --trace print trace after processing
+ -V, --version print version
USAGE
exit;
}
@@ -93,7 +93,7 @@
sub process
{
- unless ($valid_languages{$lang}) {
+ unless ($valid_languages{lc $lang}) {
warn "Language [$lang] isn't supported, switching to default [", LANG_DEFAULT, "]\n";
$lang = $args{lang} = LANG_DEFAULT;
}
@@ -143,14 +143,14 @@
=head1 SYNOPSIS
Usage: dateparse [switches]
- -f, --format format of numeric dates
- -h, --help this help screen
- -l, --lang language code
- -p, --prefer_future use future dates (when possible)
- -s, --supported list of supported languages
- -t, --time_zone time zone string
- -T, --trace print trace after processing
- -V, --version print version
+ -f, --format=<format> format of numeric dates
+ -h, --help this help screen
+ -l, --lang=<code> language code
+ -p, --prefer_future use future dates (when possible)
+ -s, --supported list of supported languages
+ -t, --time_zone=<string> time zone string
+ -T, --trace print trace after processing
+ -V, --version print version
=head1 AUTHOR
Modified: trunk/libdatetime-format-natural-perl/t/00-load.t
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libdatetime-format-natural-perl/t/00-load.t?rev=59466&op=diff
==============================================================================
--- trunk/libdatetime-format-natural-perl/t/00-load.t (original)
+++ trunk/libdatetime-format-natural-perl/t/00-load.t Thu Jun 17 05:25:59 2010
@@ -10,7 +10,7 @@
my @modules = qw(
DateTime::Format::Natural
DateTime::Format::Natural::Aliases
- DateTime::Format::Natural::Base
+ DateTime::Format::Natural::Calc
DateTime::Format::Natural::Compat
DateTime::Format::Natural::Duration
DateTime::Format::Natural::Formatted
More information about the Pkg-perl-cvs-commits
mailing list