[Jifty-commit] r2595 - in Jifty-DBI/branches/od: . lib/Jifty

jifty-commit at lists.jifty.org jifty-commit at lists.jifty.org
Fri Jan 26 08:32:46 EST 2007


Author: audreyt
Date: Fri Jan 26 08:32:46 2007
New Revision: 2595

Modified:
   Jifty-DBI/branches/od/Changes
   Jifty-DBI/branches/od/META.yml
   Jifty-DBI/branches/od/Makefile.PL
   Jifty-DBI/branches/od/SIGNATURE
   Jifty-DBI/branches/od/lib/Jifty/DBI.pm
   Jifty-DBI/branches/od/lib/Jifty/DBI/Schema.pm

Log:
* This be 0.39_999.

- Improved error message for "length is 42":

 Due to an incompatible API change, the "length" field in
 Jifty::DBI columns has been renamed to "max_length":
 
     column foo =>
         length is 10;       # NOT VALID 

 Please write this instead:
 
     column foo =>
         max_length is 10    # VALID

- Calling 'column' within a schema class is an error:
 
    package TestApp::Address::Schema;
    column address => ...;        # NOT VALID

  Please write this instead:

    package TestApp::Address;
    use Jifty::DBI::Schema;
    use Jifty::DBI::Record schema {
        column address => ...;    # VALID
    };



Modified: Jifty-DBI/branches/od/Changes
==============================================================================
--- Jifty-DBI/branches/od/Changes	(original)
+++ Jifty-DBI/branches/od/Changes	Fri Jan 26 08:32:46 2007
@@ -1,5 +1,40 @@
 Revision history for Perl extension Jifty::DBI.
 
+0.39_999 Fri Jan 26 21:30:48 CST 2007
+
+- Improved error message for "length is 42":
+
+ Due to an incompatible API change, the "length" field in
+ Jifty::DBI columns has been renamed to "max_length":
+ 
+     column foo =>
+         length is 10;       # NOT VALID 
+
+ Please write this instead:
+ 
+     column foo =>
+         max_length is 10    # VALID
+
+- Calling 'column' within a schema class is an error:
+ 
+    package TestApp::Address::Schema;
+    column address => ...;        # NOT VALID
+
+  Please write this instead:
+
+    package TestApp::Address;
+    use Jifty::DBI::Schema;
+    use Jifty::DBI::Record schema {
+        column address => ...;    # VALID
+    };
+
+
+0.39_99 Fri Jan 26 19:57:48 CST 2007
+
+- INCOMPATIBLE API CHANGE: "length is 42" must be written as "max_length is 42" instead.
+- Switch to Object::Declare for schema declaration, fixing many annoyances such as the inability for two modules to refer to each other in their columns.
+- "refers Foo::Bar", a new alias to "refers_to Foo::Bar".
+
 0.31 Fri Jan 26 19:52:08 CST 2007
 
 - load, load_by_cols, load_from_hash and create are now optionally class methods.

Modified: Jifty-DBI/branches/od/META.yml
==============================================================================
--- Jifty-DBI/branches/od/META.yml	(original)
+++ Jifty-DBI/branches/od/META.yml	Fri Jan 26 08:32:46 2007
@@ -29,6 +29,7 @@
   Encode: 2.1
   Exporter::Lite: 0
   Lingua::EN::Inflect: 0
+  Object::Declare: 0.21
   UNIVERSAL::require: 0
   perl: 5.8.3
-version: 0.31
+version: 0.39_99

Modified: Jifty-DBI/branches/od/Makefile.PL
==============================================================================
--- Jifty-DBI/branches/od/Makefile.PL	(original)
+++ Jifty-DBI/branches/od/Makefile.PL	Fri Jan 26 08:32:46 2007
@@ -17,7 +17,7 @@
 requires('Encode'  => 2.10);
 requires('Exporter::Lite');
 requires('Lingua::EN::Inflect');
-requires('Object::Declare');
+requires('Object::Declare' => 0.21);
 requires('UNIVERSAL::require');
 build_requires('Test::More' => 0.52);
 build_requires('DBD::SQLite');

Modified: Jifty-DBI/branches/od/SIGNATURE
==============================================================================
--- Jifty-DBI/branches/od/SIGNATURE	(original)
+++ Jifty-DBI/branches/od/SIGNATURE	Fri Jan 26 08:32:46 2007
@@ -14,16 +14,16 @@
 -----BEGIN PGP SIGNED MESSAGE-----
 Hash: SHA1
 
-SHA1 d614b094c30c33f6aebb097ea4ca28ad7754ae9c Changes
+SHA1 6cdd320e5387932cd7b6305d5b5068ac31cef0cb Changes
 SHA1 3bf592c9da2a5718e9be45c822f200bea821746b MANIFEST
-SHA1 be768ae02234f3c40a879413345018c563f9593d META.yml
-SHA1 38715641f85f55e5597415ab4d53e6c28ef8193f Makefile.PL
+SHA1 4ec2a6194a414a8f956ec29587219f5b0b0e5d58 META.yml
+SHA1 45d5f1856267d73c7a4a21f8f584b15cfd1bae9b Makefile.PL
 SHA1 d0943ab047f543c92405564ab77ba008052544e6 README
 SHA1 82d6ac3f6def48558d09f8b6e3b53ed4194d8c81 ROADMAP
 SHA1 9d304f35438f847863969f6a069598379f5a9db2 debian/README
-SHA1 a6d0316e3dadd3f304a9184cba0c185f7e2ec2c4 debian/changelog
+SHA1 9fd83b906fae49f559fe5d6f8a6912b63dd34154 debian/changelog
 SHA1 5d9474c0309b7ca09a182d888f73b37a8fe1362c debian/compat
-SHA1 5858fc2e749010e213c187b62dc89688bbe108c7 debian/control
+SHA1 24cc11618a487ebaa24b7538eca0c066a51ad513 debian/control
 SHA1 c1085db4f95bd6e7e7470ccab55f8adba10d5024 debian/rules
 SHA1 c28087e498978a1a314dfcaa584844703f31ac8c doc/notes/on_intuitive_schema_definitions
 SHA1 584c0f6cdebcbf760dfca8413c94783586120214 ex/Example/Model/Address.pm
@@ -40,11 +40,11 @@
 SHA1 f1d4e1bbcb40bb269f36e6dc011b3ca25d3829b7 inc/Module/Install/Metadata.pm
 SHA1 0c2118868ef82ac517eb6d9c3bd93e6eb9bbf83e inc/Module/Install/Win32.pm
 SHA1 e827d6d43771032fa3df35c0ad5e5698d0e54cda inc/Module/Install/WriteAll.pm
-SHA1 185c7497ac25bc21084a4ac6bd6173cf42a303b2 lib/Jifty/DBI.pm
-SHA1 8c257d0dfcd1f5e033a96cc51413150a72456b91 lib/Jifty/DBI/Collection.pm
+SHA1 83f0a75d698ab7ab174f42bb19e346b23fb4ba5e lib/Jifty/DBI.pm
+SHA1 b9ad69976fe3438c0528057fe972bb5741824af6 lib/Jifty/DBI/Collection.pm
 SHA1 ecfae7430da875a856113e0c233daa0e31073000 lib/Jifty/DBI/Collection/Union.pm
 SHA1 07115934091da72e0025c9c754714fc0ceedbef5 lib/Jifty/DBI/Collection/Unique.pm
-SHA1 7f7e9b1d9f18bdf5c27f5e788dbea65e3a8b78e6 lib/Jifty/DBI/Column.pm
+SHA1 ef9a50bac5f2dfa90936c5d155d1be82b7f4dced lib/Jifty/DBI/Column.pm
 SHA1 a2c16702f3467a220e9ba96ac5e086cc2e7779d1 lib/Jifty/DBI/Filter.pm
 SHA1 87192bf64a224cbea78770f4209ecae9981f3f5c lib/Jifty/DBI/Filter/Date.pm
 SHA1 e7d1ddfa3a55f69680d8637071b53d516ad0fc7d lib/Jifty/DBI/Filter/DateTime.pm
@@ -65,15 +65,15 @@
 SHA1 e6041a34c3044ed8b9691a5629ecf146fed95257 lib/Jifty/DBI/Handle/mysql.pm
 SHA1 f2cc4fcce79c9a88a023d4e6bd96c2089eef1ced lib/Jifty/DBI/Handle/mysqlPP.pm
 SHA1 0e975f9ec5480ca09025c592c06d484058e637df lib/Jifty/DBI/HasFilters.pm
-SHA1 1b237da9823f4bf949f1b290d3ad1cee1202d297 lib/Jifty/DBI/Record.pm
+SHA1 da3d76a58bdb72d26fff9717b4e29a3e058d4641 lib/Jifty/DBI/Record.pm
 SHA1 eb7085a11cc38f6a1e4b0256b43e590730666b29 lib/Jifty/DBI/Record/Cachable.pm
 SHA1 91bf502236779f5e3aa04f6c7cabdcffc413ab81 lib/Jifty/DBI/Record/Memcached.pm
-SHA1 b89c54227305bbfa78afbc4a04aba734ad22fe9a lib/Jifty/DBI/Schema.pm
+SHA1 6bdf9f32e1555c08d47e06782428b151b37b28ad lib/Jifty/DBI/Schema.pm
 SHA1 3a967c8385ad5e8ecb76b0c6374cfa2a092dffe3 lib/Jifty/DBI/SchemaGenerator.pm
 SHA1 32834b7c4cf5a8d131382fccc8db341be8768291 t/00.load.t
 SHA1 9aa7fed2b2409faa4c71d2a45db210721f47403e t/01-version_checks.t
 SHA1 13c9fe3eeec0d000a7c86ea2474e30186cbc37e2 t/01basics.t
-SHA1 ad7bb51cab6fb9d6438cae872ef4668f377e9a52 t/01records.t
+SHA1 5acefb1e751c4a21e38ceb9fa37063c07d2d37dc t/01records.t
 SHA1 b1d9bb663d106e6874c0c454d64819e6b67d56d2 t/01searches.t
 SHA1 933ebc7f0cfcaf03a2092a7c8271f98b2385f785 t/02-column_constraints.t
 SHA1 70fbf72948bdd7cabcfcf128d8f51365abb33e9c t/02records_cachable.t
@@ -85,8 +85,8 @@
 SHA1 f0f6ce9d48f419de6ac6154684f9065f32e30ddd t/06filter_truncate.t
 SHA1 2e9777a47e3a920d063bfbf9d56375c67c5b89c5 t/06filter_utf8.t
 SHA1 824e48c66d2e18120b377934177745680785525b t/10schema.t
-SHA1 44291153e6f73ecd6d3f465c06bd0477943ae025 t/11schema_records.t
-SHA1 c071b919b08fd107eb86eecc511f61d7c9cbb61a t/12prefetch.t
+SHA1 423461800861653032758627a82465426968da8e t/11schema_records.t
+SHA1 7356c3470a6b493e061df45bd75dd23bf574dd5a t/12prefetch.t
 SHA1 a93e0ee622b2291f797887f663f33c30fc7339f6 t/13collection.t
 SHA1 f057b643275b0370ae18d47b3a1b394791c850d6 t/14handle-pg.t
 SHA1 e9c6a5881fc60173fbc8d479c1afd2ce3b43bef1 t/pod.t
@@ -95,7 +95,7 @@
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1.4.3 (Darwin)
 
-iD8DBQFFuevZtLPdNzw1AaARAoIoAJ975+MJcaBwzFyQqbddZXVDgtxfSQCgpxj5
-elXyBVPg712hau/ysL8b4jw=
-=CtBF
+iD8DBQFFugLdtLPdNzw1AaARAltYAJ95LhUeZ25Cvcks76+mo1XPY6bLQACgtLni
+7OaieYv8XYph2Ik0KShAEoI=
+=nRK2
 -----END PGP SIGNATURE-----

Modified: Jifty-DBI/branches/od/lib/Jifty/DBI.pm
==============================================================================
--- Jifty-DBI/branches/od/lib/Jifty/DBI.pm	(original)
+++ Jifty-DBI/branches/od/lib/Jifty/DBI.pm	Fri Jan 26 08:32:46 2007
@@ -2,7 +2,7 @@
 use warnings;
 use strict;
 
-$Jifty::DBI::VERSION = '0.31';
+$Jifty::DBI::VERSION = '0.39_999';
 
 =head1 NAME
 

Modified: Jifty-DBI/branches/od/lib/Jifty/DBI/Schema.pm
==============================================================================
--- Jifty-DBI/branches/od/lib/Jifty/DBI/Schema.pm	(original)
+++ Jifty-DBI/branches/od/lib/Jifty/DBI/Schema.pm	Fri Jan 26 08:32:46 2007
@@ -78,22 +78,19 @@
     my $old_sig_die = $SIG{__DIE__};
 
     $SIG{__DIE__} = sub {
-        if (!@_) {
-            # Calling it by hand means we restore the old sighandler.
-            $SIG{__DIE__} = $old_sig_die;
-            return;
-        }
+        # Calling it by hand means we restore the old sighandler.
+        $SIG{__DIE__} = (($old_sig_die == $SIG{__DIE__}) ? undef : $old_sig_die);
+        return unless @_;
 
+        local $SIG{__DIE__} = sub { 1 };
         if ($_[0] =~ /near "is (\d+)"/) {
-            push @_, << ".";
+            carp @_, << ".";
 
 *********************************************************
 
  Due to an incompatible API change, the "length" field in
- Jifty::DBI columns has been renamed to "max_length".
+ Jifty::DBI columns has been renamed to "max_length":
  
- Instead of this:
-
      column foo =>
          length is $1;       # NOT VALID 
 
@@ -108,6 +105,34 @@
 
 
 .
+            exit 1;
+        }
+        elsif ($_[0] =~ /Undefined subroutine &Jifty::DBI::Schema::column|Can't locate object method "type" via package "(?:is|are)"/) {
+            my $from = (caller)[0];
+            $from =~ s/::Schema$//;
+            my $base = $INC{'Jifty/Record.pm'} ? "Jifty::Record" : "Jifty::DBI::Record";
+
+            no strict 'refs';
+            carp @_, << ".";
+*********************************************************
+
+ Calling 'column' within a schema class is an error:
+ 
+    package $from\::Schema;
+    column foo => ...;        # NOT VALID
+
+ Please write this instead:
+
+    package $from;
+    use Jifty::DBI::Schema;
+    use @{[(${"$from\::ISA"} || [$base])->[0] || $base]} schema {
+        column foo => ...;    # VALID
+    };
+
+ Sorry for the inconvenience.
+
+*********************************************************
+.
         }
 
         die @_;


More information about the Jifty-commit mailing list