switch to DateTime::Format::Sybase
Rafael Kitover [Sat, 13 Jun 2009 03:57:40 +0000 (03:57 +0000)]
Makefile.PL
lib/DBIx/Class/Storage/DBI/Sybase.pm
lib/DBIx/Class/Storage/DBI/Sybase/DateTime.pm [deleted file]
t/746sybase.t

index a9ad2d4..381644d 100644 (file)
@@ -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) {
index 4ffaae2..e60b5e2 100644 (file)
@@ -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<DATETIME> and C<SMALLDATETIME> columns, although
 C<SMALLDATETIME> columns only have minute precision.
 
-You will need the L<DateTime::Format::Strptime> module if you are going to use
+You will need the L<DateTime::Format::Sybase> module if you are going to use
 L<DBIx::Class::InflateColumn::DateTime>.
 
 =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 (file)
index 9495665..0000000
+++ /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<DBIx::Class>.
-
-=head1 DESCRIPTION
-
-This needs to become L<DateTime::Format::Sybase>.
-
-=head1 AUTHORS
-
-See L<DBIx::Class/CONTRIBUTORS>.
-
-=head1 LICENSE
-
-You may distribute this code under the same terms as Perl itself.
-
-=cut
-# vim:sts=2 sw=2:
index 16823ba..3cb0ca0 100644 (file)
@@ -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({