[Bast-commits] r7697 - in DBIx-Class/0.08/trunk: lib/DBIx
lib/DBIx/Class lib/DBIx/Class/Storage lib/DBIx/Class/Storage/DBI t
ribasushi at dev.catalyst.perl.org
ribasushi at dev.catalyst.perl.org
Fri Sep 18 18:38:26 GMT 2009
Author: ribasushi
Date: 2009-09-18 18:38:26 +0000 (Fri, 18 Sep 2009)
New Revision: 7697
Modified:
DBIx-Class/0.08/trunk/lib/DBIx/Class.pm
DBIx-Class/0.08/trunk/lib/DBIx/Class/Componentised.pm
DBIx-Class/0.08/trunk/lib/DBIx/Class/Cursor.pm
DBIx-Class/0.08/trunk/lib/DBIx/Class/Storage/DBI/Cursor.pm
DBIx-Class/0.08/trunk/lib/DBIx/Class/Storage/Statistics.pm
DBIx-Class/0.08/trunk/t/05components.t
Log:
Clear up some legacy cruft and straighten inheritance
Modified: DBIx-Class/0.08/trunk/lib/DBIx/Class/Componentised.pm
===================================================================
--- DBIx-Class/0.08/trunk/lib/DBIx/Class/Componentised.pm 2009-09-18 18:09:04 UTC (rev 7696)
+++ DBIx-Class/0.08/trunk/lib/DBIx/Class/Componentised.pm 2009-09-18 18:38:26 UTC (rev 7697)
@@ -4,31 +4,10 @@
use strict;
use warnings;
+###
+# Keep this class for backwards compatibility
+###
+
use base 'Class::C3::Componentised';
-use Carp::Clan qw/^DBIx::Class/;
-sub inject_base {
- my ($class, $target, @to_inject) = @_;
- {
- no strict 'refs';
- foreach my $to (reverse @to_inject) {
- my @comps = qw(DigestColumns ResultSetManager Ordered UTF8Columns);
- # Add components here that need to be loaded before Core
- foreach my $first_comp (@comps) {
- if ($to eq 'DBIx::Class::Core' &&
- $target->isa("DBIx::Class::${first_comp}")) {
- carp "Possible incorrect order of components in ".
- "${target}::load_components($first_comp) call: Core loaded ".
- "before $first_comp. See the documentation for ".
- "DBIx::Class::$first_comp for more information";
- }
- }
- unshift( @{"${target}::ISA"}, $to )
- unless ($target eq $to || $target->isa($to));
- }
- }
-
- $class->next::method($target, @to_inject);
-}
-
1;
Modified: DBIx-Class/0.08/trunk/lib/DBIx/Class/Cursor.pm
===================================================================
--- DBIx-Class/0.08/trunk/lib/DBIx/Class/Cursor.pm 2009-09-18 18:09:04 UTC (rev 7696)
+++ DBIx-Class/0.08/trunk/lib/DBIx/Class/Cursor.pm 2009-09-18 18:38:26 UTC (rev 7697)
@@ -3,6 +3,8 @@
use strict;
use warnings;
+use base qw/DBIx::Class/;
+
=head1 NAME
DBIx::Class::Cursor - Abstract object representing a query cursor on a
Modified: DBIx-Class/0.08/trunk/lib/DBIx/Class/Storage/DBI/Cursor.pm
===================================================================
--- DBIx-Class/0.08/trunk/lib/DBIx/Class/Storage/DBI/Cursor.pm 2009-09-18 18:09:04 UTC (rev 7696)
+++ DBIx-Class/0.08/trunk/lib/DBIx/Class/Storage/DBI/Cursor.pm 2009-09-18 18:38:26 UTC (rev 7697)
@@ -3,11 +3,7 @@
use strict;
use warnings;
-use base qw/
- Class::Accessor::Grouped
- DBIx::Class::Cursor
-/;
-use mro 'c3';
+use base qw/DBIx::Class::Cursor/;
__PACKAGE__->mk_group_accessors('simple' =>
qw/sth/
Modified: DBIx-Class/0.08/trunk/lib/DBIx/Class/Storage/Statistics.pm
===================================================================
--- DBIx-Class/0.08/trunk/lib/DBIx/Class/Storage/Statistics.pm 2009-09-18 18:09:04 UTC (rev 7696)
+++ DBIx-Class/0.08/trunk/lib/DBIx/Class/Storage/Statistics.pm 2009-09-18 18:38:26 UTC (rev 7697)
@@ -2,7 +2,7 @@
use strict;
use warnings;
-use base qw/Class::Accessor::Grouped/;
+use base qw/DBIx::Class/;
use IO::File;
__PACKAGE__->mk_group_accessors(simple => qw/callback debugfh silence/);
Modified: DBIx-Class/0.08/trunk/lib/DBIx/Class.pm
===================================================================
--- DBIx-Class/0.08/trunk/lib/DBIx/Class.pm 2009-09-18 18:09:04 UTC (rev 7696)
+++ DBIx-Class/0.08/trunk/lib/DBIx/Class.pm 2009-09-18 18:38:26 UTC (rev 7697)
@@ -6,7 +6,7 @@
use MRO::Compat;
use vars qw($VERSION);
-use base qw/DBIx::Class::Componentised Class::Accessor::Grouped/;
+use base qw/Class::C3::Componentised Class::Accessor::Grouped/;
use DBIx::Class::StartupCheck;
sub mk_classdata {
Modified: DBIx-Class/0.08/trunk/t/05components.t
===================================================================
--- DBIx-Class/0.08/trunk/t/05components.t 2009-09-18 18:09:04 UTC (rev 7696)
+++ DBIx-Class/0.08/trunk/t/05components.t 2009-09-18 18:38:26 UTC (rev 7697)
@@ -7,8 +7,6 @@
use lib qw(t/lib);
use DBICTest::ForeignComponent;
-plan tests => 6;
-
# Tests if foreign component was loaded by calling foreign's method
ok( DBICTest::ForeignComponent->foreign_test_method, 'foreign component' );
@@ -35,32 +33,7 @@
'inject_base filters duplicates'
);
-# Test for a warning with incorrect order in load_components
-my @warnings = ();
-{
- package A::Test;
- our @ISA = 'DBIx::Class';
- {
- local $SIG{__WARN__} = sub { push @warnings, shift};
- __PACKAGE__->load_components(qw(Core UTF8Columns));
- }
-}
-like( $warnings[0], qr/Core loaded before UTF8Columns/,
- 'warning issued for incorrect order in load_components()' );
-is( scalar @warnings, 1,
- 'only one warning issued for incorrect load_components call' );
-
-# Test that no warning is issued for the correct order in load_components
-{
- @warnings = ();
- package B::Test;
- our @ISA = 'DBIx::Class';
- {
- local $SIG{__WARN__} = sub { push @warnings, shift };
- __PACKAGE__->load_components(qw(UTF8Columns Core));
- }
-}
-is( scalar @warnings, 0,
- 'warning not issued for correct order in load_components()' );
-
use_ok('DBIx::Class::AccessorGroup');
+use_ok('DBIx::Class::Componentised');
+
+done_testing;
More information about the Bast-commits
mailing list