From: Matt S Trout Date: Tue, 19 Jul 2005 16:41:08 +0000 (+0000) Subject: Build.PL added, 01-columns and 02-Film pass, $VERSION added to main module X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=5d2833051802c5104220231b3d13d72d83c14b13;p=dbsrgits%2FDBIx-Class-Historic.git Build.PL added, 01-columns and 02-Film pass, $VERSION added to main module --- diff --git a/Build.PL b/Build.PL new file mode 100644 index 0000000..1035d6c --- /dev/null +++ b/Build.PL @@ -0,0 +1,19 @@ +use strict; +use Module::Build; + +my %arguments = ( + create_makefile_pl => 'passthrough', + license => 'perl', + module_name => 'DBIx::Class', + requires => { + 'DBI' => 0, + 'NEXT' => 0, + 'DBD::SQLite' => 1.08 + }, + create_makefile_pl => 'passthrough', + create_readme => 1, + test_files => [ glob('t/*.t'), glob('t/*/*.t') ] +); + +Module::Build->new(%arguments)->create_build_script; + diff --git a/lib/DBIx/Class.pm b/lib/DBIx/Class.pm index 43ce538..a67d2b7 100644 --- a/lib/DBIx/Class.pm +++ b/lib/DBIx/Class.pm @@ -1,5 +1,12 @@ package DBIx::Class; +use strict; +use warnings; + use base qw/DBIx::Class::CDBICompat DBIx::Class::Core/; +use vars qw($VERSION); + +$VERSION = '0.01'; + 1; diff --git a/lib/DBIx/Class/CDBICompat.pm b/lib/DBIx/Class/CDBICompat.pm index fd2de67..2380191 100644 --- a/lib/DBIx/Class/CDBICompat.pm +++ b/lib/DBIx/Class/CDBICompat.pm @@ -4,6 +4,7 @@ use strict; use warnings; use base qw/DBIx::Class::CDBICompat::Convenience + DBIx::Class::CDBICompat::Stringify DBIx::Class::CDBICompat::ObjIndexStubs DBIx::Class::CDBICompat::DestroyWarning DBIx::Class::CDBICompat::Constructor @@ -13,5 +14,4 @@ use base qw/DBIx::Class::CDBICompat::Convenience DBIx::Class::CDBICompat::ColumnGroups DBIx::Class::CDBICompat::ImaDBI/; - # DBIx::Class::CDBICompat::Stringify 1; diff --git a/lib/DBIx/Class/CDBICompat/Stringify.pm b/lib/DBIx/Class/CDBICompat/Stringify.pm index a3a4c28..6ba9310 100644 --- a/lib/DBIx/Class/CDBICompat/Stringify.pm +++ b/lib/DBIx/Class/CDBICompat/Stringify.pm @@ -3,16 +3,20 @@ package DBIx::Class::CDBICompat::Stringify; use strict; use warnings; +use Scalar::Util; + use overload - '""' => sub { shift->stringify_self }; + '""' => sub { + return Scalar::Util::refaddr($_[0]) if (caller)[0] eq 'NEXT'; + return shift->stringify_self; }, + fallback => 1; sub stringify_self { my $self = shift; - #return (ref $self || $self) unless $self; # empty PK - #return ref $self unless $self; my @cols = $self->columns('Stringify'); - #@cols = $self->primary_column unless @cols; - #return join "/", map { $self->get($_) } @cols; + @cols = $self->primary_column unless @cols; + my $ret = join "/", map { $self->get($_) } @cols; + return $ret || ref $self; } 1;