From: Rafael Kitover Date: Fri, 21 Jan 2011 04:00:23 +0000 (-0500) Subject: use Class::Load X-Git-Tag: 0.07003~2 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=b622b087d74c4c085c2cadcb2e7cd0fedeb71c28;p=dbsrgits%2FDBIx-Class-Schema-Loader.git use Class::Load --- diff --git a/Makefile.PL b/Makefile.PL index 1a6444e..727620f 100644 --- a/Makefile.PL +++ b/Makefile.PL @@ -47,6 +47,7 @@ requires 'Carp::Clan' => 0; requires 'Class::Inspector' => 0; requires 'DBIx::Class' => '0.08114'; requires 'Class::Unload' => 0; +requires 'Class::Load' => 0; requires 'File::Slurp' => '9999.13'; requires 'List::MoreUtils' => 0; requires 'namespace::clean' => 0; diff --git a/lib/DBIx/Class/Schema/Loader/Base.pm b/lib/DBIx/Class/Schema/Loader/Base.pm index 99a5dd8..5e6da78 100644 --- a/lib/DBIx/Class/Schema/Loader/Base.pm +++ b/lib/DBIx/Class/Schema/Loader/Base.pm @@ -22,6 +22,7 @@ use DBIx::Class::Schema::Loader::Utils qw/split_name dumper_squashed eval_withou use DBIx::Class::Schema::Loader::Optional::Dependencies (); use Try::Tiny; use DBIx::Class (); +use Class::Load 'load_class'; use namespace::clean; our $VERSION = '0.07002'; @@ -1008,7 +1009,7 @@ sub _relbuilder { ->{ $self->naming->{relationships}}; my $relbuilder_class = 'DBIx::Class::Schema::Loader::RelBuilder'.$relbuilder_suff; - eval "require $relbuilder_class"; die $@ if $@; + load_class $relbuilder_class; $relbuilder_class->new( $self ); }; @@ -1577,8 +1578,7 @@ sub _resolve_col_accessor_collisions { my @methods; for my $class ($base, @components, $self->use_moose ? 'Moose::Object' : ()) { - eval "require ${class};"; - die $@ if $@; + load_class $class; push @methods, @{ Class::Inspector->methods($class) || [] }; }