From: Matt S Trout Date: Wed, 27 Nov 2013 20:11:12 +0000 (+0000) Subject: DBIx::Class::Bundled X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=f4a8b21ef;p=dbsrgits%2FDBIx-Class.git DBIx::Class::Bundled --- diff --git a/.gitignore b/.gitignore index 8d32a72..c7ccb96 100644 --- a/.gitignore +++ b/.gitignore @@ -20,4 +20,4 @@ t/var/ maint/.Generated_Pod examples/Schema/db -t/dqlib +lib/DBIx/Class/Bundled diff --git a/Makefile.PL b/Makefile.PL index 220810f..e06b2a3 100644 --- a/Makefile.PL +++ b/Makefile.PL @@ -8,8 +8,8 @@ use inc::Module::Install 1.06; ## TEMPORARY (and non-portable) ## Get the dq stuff ## -`rm -rf t/dqlib`; -`mkdir t/dqlib`; +`rm -rf lib/DBIx/Class/Bundled`; +`mkdir lib/DBIx/Class/Bundled`; for ( [ 'Data-Query' => 'master' ], [ 'SQL-Abstract' => 'dq' ], @@ -23,12 +23,12 @@ for ( $_->[0], scalar `GIT_DIR=$tdir/.git git rev-parse origin/$_->[1]`, ; - `git archive --format=tar --remote=file://$tdir origin/$_->[1] lib/ | tar --strip-components=1 -xC t/dqlib`; + `git archive --format=tar --remote=file://$tdir origin/$_->[1] lib/ | tar --strip-components=1 -xC lib/DBIx/Class/Bundled`; `rm -rf $tdir`; } `cpanm SQL::ReservedWords 2>&1`; -use lib 't/dqlib'; +use lib 'lib/DBIx/Class/Bundled'; ## diff --git a/lib/DBIx/Class.pm b/lib/DBIx/Class.pm index c26c9d6..9f0f2f8 100644 --- a/lib/DBIx/Class.pm +++ b/lib/DBIx/Class.pm @@ -3,6 +3,8 @@ package DBIx::Class; use strict; use warnings; +use DBIx::Class::Bundled; + our $VERSION; # Always remember to do all digits for the version even if they're 0 # i.e. first release of 0.XX *must* be 0.XX000. This avoids fBSD ports diff --git a/lib/DBIx/Class/Bundled.pm b/lib/DBIx/Class/Bundled.pm new file mode 100644 index 0000000..259667c --- /dev/null +++ b/lib/DBIx/Class/Bundled.pm @@ -0,0 +1,20 @@ +package DBIx::Class::Bundled; + +use strict; +use warnings; +use File::Spec; + +our $HERE = File::Spec->catdir( + File::Spec->rel2abs( + join '', (File::Spec->splitpath(__FILE__))[0,1] + ), + 'Bundled' + ); + +($HERE) = ($HERE =~ /^(.*)$/); # screw you, taint mode + +sub import { + unshift @INC, $HERE; +} + +1; diff --git a/t/53lean_startup.t b/t/53lean_startup.t index 1c1eadd..4cc046b 100644 --- a/t/53lean_startup.t +++ b/t/53lean_startup.t @@ -64,8 +64,6 @@ use strict; use warnings; use Test::More; -use lib 't/dqlib'; - BEGIN { plan skip_all => 'A defined PERL5OPT may inject extra deps crashing this test' if $ENV{PERL5OPT}; @@ -110,6 +108,8 @@ BEGIN { Data::Dumper::Concise + File::Spec + Module::Runtime Data::Query::Constants Data::Query::ExprHelpers diff --git a/t/dq/remap.t b/t/dq/remap.t index 83a2774..6da6fc0 100644 --- a/t/dq/remap.t +++ b/t/dq/remap.t @@ -5,10 +5,10 @@ use Test::More; use Test::Exception; use Test::Warn; use lib qw(t/lib); -use Data::Query::ExprDeclare; -use Data::Query::ExprHelpers; use DBICTest; use DBIC::SqlMakerTest; +use Data::Query::ExprDeclare; +use Data::Query::ExprHelpers; my $schema = DBICTest->init_schema(); diff --git a/t/dq/where.t b/t/dq/where.t index 5f8f605..5f31044 100644 --- a/t/dq/where.t +++ b/t/dq/where.t @@ -5,8 +5,8 @@ use Test::More; use Test::Exception; use Test::Warn; use lib qw(t/lib); -use Data::Query::ExprDeclare; use DBICTest; +use Data::Query::ExprDeclare; use DBIC::SqlMakerTest; my $schema = DBICTest->init_schema(); diff --git a/t/lib/DBICTest.pm b/t/lib/DBICTest.pm index 1ed8894..8988db9 100644 --- a/t/lib/DBICTest.pm +++ b/t/lib/DBICTest.pm @@ -4,8 +4,6 @@ package # hide from PAUSE use strict; use warnings; -use lib 't/dqlib'; - # this noop trick initializes the STDOUT, so that the TAP::Harness # issued IO::Select->can_read calls (which are blocking wtf wtf wtf) # keep spinning and scheduling jobs diff --git a/t/resultset/update_delete.t b/t/resultset/update_delete.t index 5ae48b7..3314b88 100644 --- a/t/resultset/update_delete.t +++ b/t/resultset/update_delete.t @@ -2,7 +2,6 @@ use strict; use warnings; use lib qw(t/lib); -use lib qw(t/dqlib); use Test::More; use Test::Exception;