Build.PL added, 01-columns and 02-Film pass, $VERSION added to main module
Matt S Trout [Tue, 19 Jul 2005 16:41:08 +0000 (16:41 +0000)]
Build.PL [new file with mode: 0644]
lib/DBIx/Class.pm
lib/DBIx/Class/CDBICompat.pm
lib/DBIx/Class/CDBICompat/Stringify.pm

diff --git a/Build.PL b/Build.PL
new file mode 100644 (file)
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;
+
index 43ce538..a67d2b7 100644 (file)
@@ -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;
index fd2de67..2380191 100644 (file)
@@ -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;
index a3a4c28..6ba9310 100644 (file)
@@ -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;