[Bast-commits] r8472 - in DBIx-Class/0.08/trunk: lib/DBIx/Class t

ribasushi at dev.catalyst.perl.org ribasushi at dev.catalyst.perl.org
Fri Jan 29 12:00:54 GMT 2010


Author: ribasushi
Date: 2010-01-29 12:00:54 +0000 (Fri, 29 Jan 2010)
New Revision: 8472

Modified:
   DBIx-Class/0.08/trunk/lib/DBIx/Class/Componentised.pm
   DBIx-Class/0.08/trunk/lib/DBIx/Class/Core.pm
   DBIx-Class/0.08/trunk/t/85utf8.t
Log:
Fugly 5.8 workaround

Modified: DBIx-Class/0.08/trunk/lib/DBIx/Class/Componentised.pm
===================================================================
--- DBIx-Class/0.08/trunk/lib/DBIx/Class/Componentised.pm	2010-01-29 11:15:15 UTC (rev 8471)
+++ DBIx-Class/0.08/trunk/lib/DBIx/Class/Componentised.pm	2010-01-29 12:00:54 UTC (rev 8472)
@@ -17,18 +17,24 @@
 
   no strict 'refs';
   for my $comp (reverse @_) {
-    if (
-      $comp->isa ('DBIx::Class::UTF8Columns')
-        and
-      my @broken = grep { $_ ne 'DBIx::Class::Row' and defined ${"${_}::"}{store_column} } (@present_components)
-    ) {
+
+    if ($comp->isa ('DBIx::Class::UTF8Columns') ) {
+      require B;
+      my @broken;
+
+      for (@present_components) {
+        my $cref = $_->can ('store_column')
+         or next;
+        push @broken, $_ if B::svref_2object($cref)->STASH->NAME ne 'DBIx::Class::Row';
+      }
+
       carp "Incorrect loading order of $comp by ${target} will affect other components overriding store_column ("
           . join (', ', @broken)
-          .'). Refer to the documentation of DBIx::Class::UTF8Columns for more info';
+          .'). Refer to the documentation of DBIx::Class::UTF8Columns for more info'
+       if @broken;
     }
-    else {
-      unshift @present_components, $comp;
-    }
+
+    unshift @present_components, $comp;
   }
 
   $class->next::method($target, @_);

Modified: DBIx-Class/0.08/trunk/lib/DBIx/Class/Core.pm
===================================================================
--- DBIx-Class/0.08/trunk/lib/DBIx/Class/Core.pm	2010-01-29 11:15:15 UTC (rev 8471)
+++ DBIx-Class/0.08/trunk/lib/DBIx/Class/Core.pm	2010-01-29 12:00:54 UTC (rev 8472)
@@ -2,7 +2,6 @@
 
 use strict;
 use warnings;
-no warnings 'qw';
 
 use base qw/DBIx::Class/;
 
@@ -12,7 +11,8 @@
   PK::Auto
   PK
   Row
-  ResultSourceProxy::Table/);
+  ResultSourceProxy::Table
+/);
 
 1;
 

Modified: DBIx-Class/0.08/trunk/t/85utf8.t
===================================================================
--- DBIx-Class/0.08/trunk/t/85utf8.t	2010-01-29 11:15:15 UTC (rev 8471)
+++ DBIx-Class/0.08/trunk/t/85utf8.t	2010-01-29 12:00:54 UTC (rev 8472)
@@ -7,22 +7,23 @@
 use DBICTest;
 use utf8;
 
-warning_like (sub {
+warning_like (
+  sub {
+    package A::Comp;
+    use base 'DBIx::Class';
+    sub store_column { shift->next::method (@_) };
+    1;
 
-  package A::Comp;
-  use base 'DBIx::Class';
-  sub store_column { shift->next::method (@_) };
-  1;
+    package A::Test;
+    use base 'DBIx::Class::Core';
+    __PACKAGE__->load_components(qw(UTF8Columns +A::Comp));
+    1;
+  },
+  qr/Incorrect loading order of DBIx::Class::UTF8Columns.+affect other components overriding store_column \(A::Comp\)/,
+  'incorrect order warning issued',
+);
 
-  package A::Test;
-  use base 'DBIx::Class::Core';
-  __PACKAGE__->load_components(qw(UTF8Columns +A::Comp));
-  1;
-}, qr/Incorrect loading order of DBIx::Class::UTF8Columns.+affect other components overriding store_column \(A::Comp\)/ );
-
-
 my $schema = DBICTest->init_schema();
-
 DBICTest::Schema::CD->load_components('UTF8Columns');
 DBICTest::Schema::CD->utf8_columns('title');
 Class::C3->reinitialize();




More information about the Bast-commits mailing list