[Bast-commits] r3908 - in DBIx-Class/0.08/trunk: . lib/DBIx script

perigrin at dev.catalyst.perl.org perigrin at dev.catalyst.perl.org
Wed Jan 2 20:52:13 GMT 2008


Author: perigrin
Date: 2008-01-02 20:52:13 +0000 (Wed, 02 Jan 2008)
New Revision: 3908

Modified:
   DBIx-Class/0.08/trunk/Changes
   DBIx-Class/0.08/trunk/lib/DBIx/Class.pm
   DBIx-Class/0.08/trunk/script/dbicadmin
Log:
move dbicadmin to JSON::Any

Modified: DBIx-Class/0.08/trunk/Changes
===================================================================
--- DBIx-Class/0.08/trunk/Changes	2008-01-02 08:23:15 UTC (rev 3907)
+++ DBIx-Class/0.08/trunk/Changes	2008-01-02 20:52:13 UTC (rev 3908)
@@ -2,6 +2,7 @@
 
         - Added freeze, thaw and dclone methods to Schema so that thawed
           objects will get re-attached to the schema.
+        - Moved dbicadmin to JSON::Any wrapped JSON.pm for a sane API
 
 0.08008 2007-11-16 14:30:00
         - Fixed join merging bug (test from Zby)

Modified: DBIx-Class/0.08/trunk/lib/DBIx/Class.pm
===================================================================
--- DBIx-Class/0.08/trunk/lib/DBIx/Class.pm	2008-01-02 08:23:15 UTC (rev 3907)
+++ DBIx-Class/0.08/trunk/lib/DBIx/Class.pm	2008-01-02 20:52:13 UTC (rev 3908)
@@ -258,6 +258,8 @@
 
 penguin: K J Cheetham
 
+perigrin: Chris Prather <chris at prather.org>
+
 phaylon: Robert Sedlacek <phaylon at dunkelheit.at>
 
 quicksilver: Jules Bean

Modified: DBIx-Class/0.08/trunk/script/dbicadmin
===================================================================
--- DBIx-Class/0.08/trunk/script/dbicadmin	2008-01-02 08:23:15 UTC (rev 3907)
+++ DBIx-Class/0.08/trunk/script/dbicadmin	2008-01-02 20:52:13 UTC (rev 3908)
@@ -4,11 +4,11 @@
 
 use Getopt::Long;
 use Pod::Usage;
-use JSON qw( jsonToObj );
+use JSON::Any qw(JSON);
 
-$JSON::BareKey = 1;
-$JSON::QuotApos = 1;
 
+my $json = JSON::Any->new(allow_barekey => 1, allow_singlequote => 1);
+
 GetOptions(
     'schema=s'  => \my $schema_class,
     'class=s'   => \my $resultset_class,
@@ -50,7 +50,7 @@
 die('No schema specified') if(!$schema_class);
 eval("require $schema_class");
 die('Unable to load schema') if ($@);
-$connect = jsonToObj( $connect ) if ($connect);
+$connect = $json->jsonToObj( $connect ) if ($connect);
 my $schema = $schema_class->connect(
     ( $connect ? @$connect : () )
 );
@@ -59,9 +59,9 @@
 my $resultset = eval{ $schema->resultset($resultset_class) };
 die('Unable to load the class with the schema') if ($@);
 
-$set = jsonToObj( $set ) if ($set);
-$where = jsonToObj( $where ) if ($where);
-$attrs = jsonToObj( $attrs ) if ($attrs);
+$set = $json->jsonToObj( $set ) if ($set);
+$where = $json->jsonToObj( $where ) if ($where);
+$attrs = $json->jsonToObj( $attrs ) if ($attrs);
 
 if ($op eq 'insert') {
     die('Do not use the where option with the insert op') if ($where);




More information about the Bast-commits mailing list