[Bast-commits] r8664 - in DBIx-Class/0.08/branches/dephandling:
lib/DBIx lib/DBIx/Class/Schema lib/DBIx/Class/Storage t
ribasushi at dev.catalyst.perl.org
ribasushi at dev.catalyst.perl.org
Fri Feb 12 12:45:19 GMT 2010
Author: ribasushi
Date: 2010-02-12 12:45:18 +0000 (Fri, 12 Feb 2010)
New Revision: 8664
Modified:
DBIx-Class/0.08/branches/dephandling/lib/DBIx/Class.pm
DBIx-Class/0.08/branches/dephandling/lib/DBIx/Class/Schema/Versioned.pm
DBIx-Class/0.08/branches/dephandling/lib/DBIx/Class/Storage/DBI.pm
DBIx-Class/0.08/branches/dephandling/t/86sqlt.t
DBIx-Class/0.08/branches/dephandling/t/94versioning.t
DBIx-Class/0.08/branches/dephandling/t/99dbic_sqlt_parser.t
Log:
Move sqlt dephandling to Optional::Deps
Modified: DBIx-Class/0.08/branches/dephandling/lib/DBIx/Class/Schema/Versioned.pm
===================================================================
--- DBIx-Class/0.08/branches/dephandling/lib/DBIx/Class/Schema/Versioned.pm 2010-02-12 12:40:53 UTC (rev 8663)
+++ DBIx-Class/0.08/branches/dephandling/lib/DBIx/Class/Schema/Versioned.pm 2010-02-12 12:45:18 UTC (rev 8664)
@@ -617,8 +617,9 @@
return;
}
- $self->throw_exception($self->storage->_sqlt_version_error)
- if (not $self->storage->_sqlt_version_ok);
+ unless (DBIx::Class::Optional::Dependencies->req_ok_for ('deploy')) {
+ $self->throw_exception("Unable to proceed without " . DBIx::Class::Optional::Dependencies->req_missing_for ('deploy') );
+ }
my $db_tr = SQL::Translator->new({
add_drop_table => 1,
Modified: DBIx-Class/0.08/branches/dephandling/lib/DBIx/Class/Storage/DBI.pm
===================================================================
--- DBIx-Class/0.08/branches/dephandling/lib/DBIx/Class/Storage/DBI.pm 2010-02-12 12:40:53 UTC (rev 8663)
+++ DBIx-Class/0.08/branches/dephandling/lib/DBIx/Class/Storage/DBI.pm 2010-02-12 12:45:18 UTC (rev 8664)
@@ -16,11 +16,6 @@
use Data::Dumper::Concise();
use Sub::Name ();
-# what version of sqlt do we require if deploy() without a ddl_dir is invoked
-# when changing also adjust the corresponding author_require in Makefile.PL
-my $minimum_sqlt_version = '0.11002';
-
-
__PACKAGE__->mk_group_accessors('simple' =>
qw/_connect_info _dbi_connect_info _dbh _sql_maker _sql_maker_opts _conn_pid
_conn_tid transaction_depth _dbh_autocommit _driver_determined savepoints/
@@ -2251,8 +2246,9 @@
%{$sqltargs || {}}
};
- $self->throw_exception("Can't create a ddl file without SQL::Translator: " . $self->_sqlt_version_error)
- if !$self->_sqlt_version_ok;
+ unless (DBIx::Class::Optional::Dependencies->req_ok_for ('deploy')) {
+ $self->throw_exception("Can't create a ddl file without " . DBIx::Class::Optional::Dependencies->req_missing_for ('deploy') );
+ }
my $sqlt = SQL::Translator->new( $sqltargs );
@@ -2394,8 +2390,9 @@
return join('', @rows);
}
- $self->throw_exception("Can't deploy without either SQL::Translator or a ddl_dir: " . $self->_sqlt_version_error )
- if !$self->_sqlt_version_ok;
+ unless (DBIx::Class::Optional::Dependencies->req_ok_for ('deploy') ) {
+ $self->throw_exception("Can't deploy without a ddl_dir or " . DBIx::Class::Optional::Dependencies->req_missing_for ('deploy') );
+ }
# sources needs to be a parser arg, but for simplicty allow at top level
# coming in
@@ -2519,33 +2516,6 @@
return;
}
-# SQLT version handling
-{
- my $_sqlt_version_ok; # private
- my $_sqlt_version_error; # private
-
- sub _sqlt_version_ok {
- if (!defined $_sqlt_version_ok) {
- eval "use SQL::Translator $minimum_sqlt_version";
- if ($@) {
- $_sqlt_version_ok = 0;
- $_sqlt_version_error = $@;
- }
- else {
- $_sqlt_version_ok = 1;
- }
- }
- return $_sqlt_version_ok;
- }
-
- sub _sqlt_version_error {
- shift->_sqlt_version_ok unless defined $_sqlt_version_ok;
- return $_sqlt_version_error;
- }
-
- sub _sqlt_minimum_version { $minimum_sqlt_version };
-}
-
=head2 relname_to_table_alias
=over 4
Modified: DBIx-Class/0.08/branches/dephandling/lib/DBIx/Class.pm
===================================================================
--- DBIx-Class/0.08/branches/dephandling/lib/DBIx/Class.pm 2010-02-12 12:40:53 UTC (rev 8663)
+++ DBIx-Class/0.08/branches/dephandling/lib/DBIx/Class.pm 2010-02-12 12:45:18 UTC (rev 8664)
@@ -6,6 +6,8 @@
use MRO::Compat;
use mro 'c3';
+use DBIx::Class::Optional::Dependencies;
+
use vars qw($VERSION);
use base qw/DBIx::Class::Componentised Class::Accessor::Grouped/;
use DBIx::Class::StartupCheck;
Modified: DBIx-Class/0.08/branches/dephandling/t/86sqlt.t
===================================================================
--- DBIx-Class/0.08/branches/dephandling/t/86sqlt.t 2010-02-12 12:40:53 UTC (rev 8663)
+++ DBIx-Class/0.08/branches/dephandling/t/86sqlt.t 2010-02-12 12:45:18 UTC (rev 8664)
@@ -6,10 +6,10 @@
use DBICTest;
BEGIN {
- require DBIx::Class::Storage::DBI;
+ require DBIx::Class;
plan skip_all =>
- 'Test needs SQL::Translator ' . DBIx::Class::Storage::DBI->_sqlt_minimum_version
- if not DBIx::Class::Storage::DBI->_sqlt_version_ok;
+ 'Test needs ' . DBIx::Class::Optional::Dependencies->req_missing_for ('deploy')
+ unless DBIx::Class::Optional::Dependencies->req_ok_for ('deploy')
}
my $schema = DBICTest->init_schema (no_deploy => 1);
Modified: DBIx-Class/0.08/branches/dephandling/t/94versioning.t
===================================================================
--- DBIx-Class/0.08/branches/dephandling/t/94versioning.t 2010-02-12 12:40:53 UTC (rev 8663)
+++ DBIx-Class/0.08/branches/dephandling/t/94versioning.t 2010-02-12 12:45:18 UTC (rev 8664)
@@ -22,10 +22,10 @@
|| plan skip_all => 'Test needs Time::HiRes';
Time::HiRes->import(qw/time sleep/);
- require DBIx::Class::Storage::DBI;
+ require DBIx::Class;
plan skip_all =>
- 'Test needs SQL::Translator ' . DBIx::Class::Storage::DBI->_sqlt_minimum_version
- if not DBIx::Class::Storage::DBI->_sqlt_version_ok;
+ 'Test needs ' . DBIx::Class::Optional::Dependencies->req_missing_for ('deploy')
+ unless DBIx::Class::Optional::Dependencies->req_ok_for ('deploy')
}
use lib qw(t/lib);
Modified: DBIx-Class/0.08/branches/dephandling/t/99dbic_sqlt_parser.t
===================================================================
--- DBIx-Class/0.08/branches/dephandling/t/99dbic_sqlt_parser.t 2010-02-12 12:40:53 UTC (rev 8663)
+++ DBIx-Class/0.08/branches/dephandling/t/99dbic_sqlt_parser.t 2010-02-12 12:45:18 UTC (rev 8664)
@@ -9,10 +9,10 @@
use Scalar::Util ();
BEGIN {
- require DBIx::Class::Storage::DBI;
+ require DBIx::Class;
plan skip_all =>
- 'Test needs SQL::Translator ' . DBIx::Class::Storage::DBI->_sqlt_minimum_version
- if not DBIx::Class::Storage::DBI->_sqlt_version_ok;
+ 'Test needs ' . DBIx::Class::Optional::Dependencies->req_missing_for ('deploy')
+ unless DBIx::Class::Optional::Dependencies->req_ok_for ('deploy')
}
# Test for SQLT-related leaks
More information about the Bast-commits
mailing list