[Bast-commits] r4241 - DBIx-Class/0.08/trunk/lib/DBIx/Class
schwern at dev.catalyst.perl.org
schwern at dev.catalyst.perl.org
Wed Mar 26 00:38:28 GMT 2008
Author: schwern
Date: 2008-03-26 00:38:28 +0000 (Wed, 26 Mar 2008)
New Revision: 4241
Modified:
DBIx-Class/0.08/trunk/lib/DBIx/Class/CDBICompat.pm
Log:
CDBICompat::Relationships uses Clone. Make CDBICompat not load without it
so the tests skip if it's not there.
Also improve the message to only show what's missing.
Modified: DBIx-Class/0.08/trunk/lib/DBIx/Class/CDBICompat.pm
===================================================================
--- DBIx-Class/0.08/trunk/lib/DBIx/Class/CDBICompat.pm 2008-03-25 04:03:32 UTC (rev 4240)
+++ DBIx-Class/0.08/trunk/lib/DBIx/Class/CDBICompat.pm 2008-03-26 00:38:28 UTC (rev 4241)
@@ -5,12 +5,21 @@
use base qw/DBIx::Class::Core DBIx::Class::DB/;
use Carp::Clan qw/^DBIx::Class/;
-eval {
- require Class::Trigger;
- require DBIx::ContextualFetch;
-};
-croak "Class::Trigger and DBIx::ContextualFetch is required for CDBICompat" if $@;
+# Modules CDBICompat needs that DBIx::Class does not.
+my @Extra_Modules = qw(
+ Class::Trigger
+ DBIx::ContextualFetch
+ Clone
+);
+
+my @didnt_load;
+for my $module (@Extra_Modules) {
+ push @didnt_load, $module unless eval qq{require $module};
+}
+croak("@{[ join ', ', @didnt_load ]} are missing and are required for CDBICompat")
+ if @didnt_load;
+
__PACKAGE__->load_own_components(qw/
Constraints
Triggers
More information about the Bast-commits
mailing list