From: Matt S Trout Date: Thu, 24 Nov 2005 05:27:49 +0000 (+0000) Subject: With the addition of Class::C3 0.07 and a few tweaks, C3 branch works! X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=75a23b3e351f37ed420f182492d441ccbdca6569;p=dbsrgits%2FDBIx-Class-Historic.git With the addition of Class::C3 0.07 and a few tweaks, C3 branch works! --- diff --git a/Build.PL b/Build.PL index 995fb9e..af41bb1 100644 --- a/Build.PL +++ b/Build.PL @@ -13,13 +13,13 @@ my %arguments = ( 'SQL::Abstract' => 1.20, 'SQL::Abstract::Limit' => 0.101, 'DBD::SQLite' => 1.08, + 'Class::C3' => 0.07, + 'Tie::IxHash' => 0, + 'Module::Find' => 0, + 'Storable' => 0, # Following for CDBICompat only 'Class::Trigger' => 0, 'DBIx::ContextualFetch' => 0, - 'Tie::IxHash' => 0, - 'Storable' => 0, - 'Module::Find' => 0, - 'Class::C3' => 0.05, }, recommends => { 'Data::UUID' => 0, diff --git a/lib/DBIx/Class.pm b/lib/DBIx/Class.pm index 5720cb3..d862203 100644 --- a/lib/DBIx/Class.pm +++ b/lib/DBIx/Class.pm @@ -6,7 +6,7 @@ use warnings; use vars qw($VERSION); use base qw/DBIx::Class::Componentised Class::Data::Inheritable/; -$VERSION = '0.03999_01'; +$VERSION = '0.03999_02'; 1; diff --git a/lib/DBIx/Class/AccessorGroup.pm b/lib/DBIx/Class/AccessorGroup.pm index 0625f01..03ec899 100644 --- a/lib/DBIx/Class/AccessorGroup.pm +++ b/lib/DBIx/Class/AccessorGroup.pm @@ -3,8 +3,6 @@ package DBIx::Class::AccessorGroup; use strict; use warnings; -use NEXT; - =head1 NAME DBIx::Class::AccessorGroup - Lets you build groups of accessors diff --git a/lib/DBIx/Class/CDBICompat.pm b/lib/DBIx/Class/CDBICompat.pm index 88c0818..5fb1af4 100644 --- a/lib/DBIx/Class/CDBICompat.pm +++ b/lib/DBIx/Class/CDBICompat.pm @@ -2,7 +2,7 @@ package DBIx::Class::CDBICompat; use strict; use warnings; -use base qw/DBIx::Class/; +use base qw/DBIx::Class::Core DBIx::Class::DB/; __PACKAGE__->load_own_components(qw/ Constraints @@ -16,8 +16,8 @@ __PACKAGE__->load_own_components(qw/ Constructor AccessorMapping ColumnCase - HasMany HasA + HasMany MightHave LazyLoading AutoUpdate diff --git a/lib/DBIx/Class/CDBICompat/AccessorMapping.pm b/lib/DBIx/Class/CDBICompat/AccessorMapping.pm index e1300a3..aec1653 100644 --- a/lib/DBIx/Class/CDBICompat/AccessorMapping.pm +++ b/lib/DBIx/Class/CDBICompat/AccessorMapping.pm @@ -3,8 +3,6 @@ package DBIx::Class::CDBICompat::AccessorMapping; use strict; use warnings; -use NEXT; - sub mk_group_accessors { my ($class, $group, @cols) = @_; unless ($class->can('accessor_name') || $class->can('mutator_name')) { @@ -27,23 +25,20 @@ sub mk_group_accessors { } } -sub create { +sub new { my ($class, $attrs, @rest) = @_; $class->throw( "create needs a hashref" ) unless ref $attrs eq 'HASH'; - $attrs = { %$attrs }; - my %att; foreach my $col ($class->columns) { if ($class->can('accessor_name')) { my $acc = $class->accessor_name($col); -#warn "$col $acc"; - $att{$col} = delete $attrs->{$acc} if exists $attrs->{$acc}; + $attrs->{$col} = delete $attrs->{$acc} if exists $attrs->{$acc}; } if ($class->can('mutator_name')) { my $mut = $class->mutator_name($col); - $att{$col} = delete $attrs->{$mut} if exists $attrs->{$mut}; + $attrs->{$col} = delete $attrs->{$mut} if exists $attrs->{$mut}; } } - return $class->next::method({ %$attrs, %att }, @rest); + return $class->next::method($attrs, @rest); } 1; diff --git a/lib/DBIx/Class/CDBICompat/ColumnCase.pm b/lib/DBIx/Class/CDBICompat/ColumnCase.pm index edea63a..8ef8080 100644 --- a/lib/DBIx/Class/CDBICompat/ColumnCase.pm +++ b/lib/DBIx/Class/CDBICompat/ColumnCase.pm @@ -2,7 +2,8 @@ package DBIx::Class::CDBICompat::ColumnCase; use strict; use warnings; -use NEXT; + +use base qw/DBIx::Class/; sub _register_column_group { my ($class, $group, @cols) = @_; diff --git a/lib/DBIx/Class/CDBICompat/ColumnGroups.pm b/lib/DBIx/Class/CDBICompat/ColumnGroups.pm index fc9ece3..d87e6a4 100644 --- a/lib/DBIx/Class/CDBICompat/ColumnGroups.pm +++ b/lib/DBIx/Class/CDBICompat/ColumnGroups.pm @@ -2,9 +2,8 @@ package DBIx::Class::CDBICompat::ColumnGroups; use strict; use warnings; -use NEXT; -use base qw/Class::Data::Inheritable/; +use base qw/DBIx::Class::Row/; __PACKAGE__->mk_classdata('_column_groups' => { }); diff --git a/lib/DBIx/Class/CDBICompat/ImaDBI.pm b/lib/DBIx/Class/CDBICompat/ImaDBI.pm index 3a17281..4d6e3d5 100644 --- a/lib/DBIx/Class/CDBICompat/ImaDBI.pm +++ b/lib/DBIx/Class/CDBICompat/ImaDBI.pm @@ -4,8 +4,7 @@ use strict; use warnings; use DBIx::ContextualFetch; -use NEXT; -use base qw/Class::Data::Inheritable/; +use base qw/DBIx::Class/; __PACKAGE__->mk_classdata('_transform_sql_handler_order' => [ qw/TABLE ESSENTIAL JOIN/ ] ); diff --git a/lib/DBIx/Class/CDBICompat/TempColumns.pm b/lib/DBIx/Class/CDBICompat/TempColumns.pm index 6de7fd3..1bd5c93 100644 --- a/lib/DBIx/Class/CDBICompat/TempColumns.pm +++ b/lib/DBIx/Class/CDBICompat/TempColumns.pm @@ -2,7 +2,7 @@ package DBIx::Class::CDBICompat::TempColumns; use strict; use warnings; -use base qw/Class::Data::Inheritable/; +use base qw/DBIx::Class/; __PACKAGE__->mk_classdata('_temp_columns' => { }); diff --git a/lib/DBIx/Class/Componentised.pm b/lib/DBIx/Class/Componentised.pm index 8ea297c..a89f0e8 100644 --- a/lib/DBIx/Class/Componentised.pm +++ b/lib/DBIx/Class/Componentised.pm @@ -9,7 +9,7 @@ sub inject_base { unshift(@{"${target}::ISA"}, grep { $target ne $_ } @to_inject); } my $table = { Class::C3::_dump_MRO_table }; - eval "package $target; use Class::C3;" unless exists $table->{$target}; + eval "package $target; import Class::C3;" unless exists $table->{$target}; Class::C3::reinitialize() if defined $table->{$target}; } diff --git a/lib/DBIx/Class/InflateColumn.pm b/lib/DBIx/Class/InflateColumn.pm index 7619e5a..c612832 100644 --- a/lib/DBIx/Class/InflateColumn.pm +++ b/lib/DBIx/Class/InflateColumn.pm @@ -2,6 +2,7 @@ package DBIx::Class::InflateColumn; use strict; use warnings; +use base qw/DBIx::Class::Row/; sub inflate_column { my ($self, $col, $attrs) = @_; diff --git a/script/nextalyzer.pl b/script/nextalyzer.pl deleted file mode 100755 index 4a32db1..0000000 --- a/script/nextalyzer.pl +++ /dev/null @@ -1,72 +0,0 @@ -#!/usr/bin/perl - -use strict; -use warnings; -use Class::ISA; - -my $class = $ARGV[0]; - -die "usage: nextalyzer Some::Class" unless $class; - -eval "use $class;"; - -die "Error using $class: $@" if $@; - -my @path = reverse Class::ISA::super_path($class); - -my %provided; -my %overloaded; - -my @warnings; - -foreach my $super (@path) { - my $file = $super; - $file =~ s/\:\:/\//g; - $file .= '.pm'; - my $file_path = $INC{$file}; - die "Couldn't get INC for $file, super $super" unless $file_path; - #warn "$super $file $file_path"; - open IN, '<', $file_path; - my $in_sub; - my $ws; - my $uses_next; - my @provides; - my @overloads; - while (my $line = ) { - unless ($in_sub) { - ($ws, $in_sub) = ($line =~ /^(\s*)sub (\S+)/); - next unless $in_sub; - } - if ($line =~ /^$ws\}/) { - if ($uses_next) { - push(@overloads, $in_sub); - } else { - push(@provides, $in_sub); - } - undef $in_sub; - undef $uses_next; - undef $ws; - next; - } - $uses_next++ if ($line =~ /\-\>NEXT/); - } - close IN; - foreach (@overloads) { - push(@warnings, "Method $_ overloaded in $class but not yet provided") - unless $provided{$_}; - push(@{$overloaded{$_}}, $super); - } - $provided{$_} = $super for @provides; - print "Class $super:\n"; - print "Provides: @provides\n"; - print "Overloads: @overloads\n"; -} - -print "\n\n"; - -print join("\n", @warnings); - -foreach my $o (keys %overloaded) { - my $pr = $provided{$o} || "**NEVER**"; - print "Method $o: ".join(' ', reverse @{$overloaded{$o}})." ${pr}\n"; -}