From: Rafael Kitover Date: Sat, 13 Jun 2009 03:57:40 +0000 (+0000) Subject: switch to DateTime::Format::Sybase X-Git-Tag: v0.08112~14^2~133 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=c21c1eb620b0d28e9430e506997876398603e284;p=dbsrgits%2FDBIx-Class.git switch to DateTime::Format::Sybase --- diff --git a/Makefile.PL b/Makefile.PL index a9ad2d4..381644d 100644 --- a/Makefile.PL +++ b/Makefile.PL @@ -98,7 +98,7 @@ my %force_requires_if_author = ( 'Hash::Merge', => 0.11, # t/746sybase.t - 'DateTime::Format::Strptime' => 0, + 'DateTime::Format::Sybase' => 0, ); if ($Module::Install::AUTHOR) { diff --git a/lib/DBIx/Class/Storage/DBI/Sybase.pm b/lib/DBIx/Class/Storage/DBI/Sybase.pm index 4ffaae2..e60b5e2 100644 --- a/lib/DBIx/Class/Storage/DBI/Sybase.pm +++ b/lib/DBIx/Class/Storage/DBI/Sybase.pm @@ -99,7 +99,7 @@ sub count { return $count - $offset; } -sub datetime_parser_type { "DBIx::Class::Storage::DBI::Sybase::DateTime" } +sub datetime_parser_type { "DateTime::Format::Sybase" } 1; @@ -133,7 +133,7 @@ C<08/13/1979 18:08:55.080>. This works for both C and C columns, although C columns only have minute precision. -You will need the L module if you are going to use +You will need the L module if you are going to use L. =head1 AUTHORS diff --git a/lib/DBIx/Class/Storage/DBI/Sybase/DateTime.pm b/lib/DBIx/Class/Storage/DBI/Sybase/DateTime.pm deleted file mode 100644 index 9495665..0000000 --- a/lib/DBIx/Class/Storage/DBI/Sybase/DateTime.pm +++ /dev/null @@ -1,40 +0,0 @@ -package # hide from PAUSE - DBIx::Class::Storage::DBI::Sybase::DateTime; - -use strict; -use warnings; -use DateTime::Format::Strptime; - -my $inflate_format = DateTime::Format::Strptime->new( - pattern => '%Y-%m-%dT%H:%M:%S.%3NZ' -); - -my $deflate_format = DateTime::Format::Strptime->new( - pattern => '%m/%d/%Y %H:%M:%S.%3N' -); - -sub parse_datetime { shift; $inflate_format->parse_datetime(@_) } - -sub format_datetime { shift; $deflate_format->format_datetime(@_) } - -1; - -=head1 NAME - -DBIx::Class::Storage::DBI::Sybase::DateTime - DateTime inflation/deflation -support for Sybase in L. - -=head1 DESCRIPTION - -This needs to become L. - -=head1 AUTHORS - -See L. - -=head1 LICENSE - -You may distribute this code under the same terms as Perl itself. - -=cut -# vim:sts=2 sw=2: diff --git a/t/746sybase.t b/t/746sybase.t index 16823ba..3cb0ca0 100644 --- a/t/746sybase.t +++ b/t/746sybase.t @@ -4,7 +4,7 @@ use warnings; use Test::More; use lib qw(t/lib); use DBICTest; -use DBIx::Class::Storage::DBI::Sybase::DateTime; +use DateTime::Format::Sybase; my ($dsn, $user, $pass) = @ENV{map { "DBICTEST_SYBASE_${_}" } qw/DSN USER PASS/}; @@ -123,8 +123,7 @@ CREATE TABLE track ( last_updated_on $type, ) SQL - ok(my $dt = DBIx::Class::Storage::DBI::Sybase::DateTime - ->parse_datetime($sample_dt)); + ok(my $dt = DateTime::Format::Sybase->parse_datetime($sample_dt)); my $row; ok( $row = $schema->resultset('Track')->create({