From: Arthur Axel "fREW" Schmidt Date: Wed, 2 Jun 2010 05:05:39 +0000 (+0000) Subject: perl modules shouldnt munge @INC; thats the job of the script X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=312eef081e74f1fed2329079ee4a9e5174d58699;p=dbsrgits%2FDBIx-Class-Historic.git perl modules shouldnt munge @INC; thats the job of the script --- diff --git a/lib/DBIx/Class/Admin.pm b/lib/DBIx/Class/Admin.pm index be90ae1..7052fbf 100644 --- a/lib/DBIx/Class/Admin.pm +++ b/lib/DBIx/Class/Admin.pm @@ -85,33 +85,15 @@ has 'schema' => ( lazy_build => 1, ); -sub BUILD { - my $self = shift; - require Class::MOP; - - my @include_dirs = @{$self->include_dirs}; - @INC = (@include_dirs, @INC); - Class::MOP::load_class($self->schema_class); -} - sub _build_schema { my ($self) = @_; + + require Class::MOP; + Class::MOP::load_class($self->schema_class); $self->connect_info->[3]{ignore_version} = 1; return $self->schema_class->connect(@{$self->connect_info}); } -=head2 include_dirs - -Extra include directories to look when loading C - -=cut - -has 'include_dirs' => ( - is => 'rw', - isa => 'ArrayRef', - default => sub {[]} -); - =head2 resultset a resultset from the schema to operate on diff --git a/script/dbicadmin b/script/dbicadmin index c2b9ccf..6ab9d09 100755 --- a/script/dbicadmin +++ b/script/dbicadmin @@ -14,6 +14,7 @@ BEGIN { use DBIx::Class::Admin::Descriptive; #use Getopt::Long::Descriptive; use DBIx::Class::Admin; +require lib; my $short_description = "utility for administrating DBIx::Class schemata"; my $synopsis_text =q| @@ -89,7 +90,7 @@ if($opts->{selfinject_pod}) { # FIXME - lowercasing will eventually go away when Getopt::Long::Descriptive is fixed if($opts->{i}) { - $opts->{include_dirs} = delete $opts->{i}; + lib->import(delete $opts->{i}); } if($opts->{help}) {