r63058 - in /trunk/libjson-perl: Changes MANIFEST META.yml README debian/changelog debian/copyright debian/libjson-perl.examples lib/JSON.pm lib/JSON/PP.pm t/e10_bignum.t t/e15_tie_ixhash.t t/xe19_xs_and_suportbypp.t t/xe20_croak_message.t

angelabad-guest at users.alioth.debian.org angelabad-guest at users.alioth.debian.org
Tue Sep 28 19:49:09 UTC 2010


Author: angelabad-guest
Date: Tue Sep 28 19:48:55 2010
New Revision: 63058

URL: http://svn.debian.org/wsvn/pkg-perl/?sc=1&rev=63058
Log:
* New upstream release
* debian/copyright: Update license information
* debian/libjson-perl.examples: Add example files

Added:
    trunk/libjson-perl/debian/libjson-perl.examples
    trunk/libjson-perl/t/e15_tie_ixhash.t
      - copied unchanged from r63057, branches/upstream/libjson-perl/current/t/e15_tie_ixhash.t
    trunk/libjson-perl/t/xe19_xs_and_suportbypp.t
      - copied unchanged from r63057, branches/upstream/libjson-perl/current/t/xe19_xs_and_suportbypp.t
    trunk/libjson-perl/t/xe20_croak_message.t
      - copied unchanged from r63057, branches/upstream/libjson-perl/current/t/xe20_croak_message.t
Modified:
    trunk/libjson-perl/Changes
    trunk/libjson-perl/MANIFEST
    trunk/libjson-perl/META.yml
    trunk/libjson-perl/README
    trunk/libjson-perl/debian/changelog
    trunk/libjson-perl/debian/copyright
    trunk/libjson-perl/lib/JSON.pm
    trunk/libjson-perl/lib/JSON/PP.pm
    trunk/libjson-perl/t/e10_bignum.t

Modified: trunk/libjson-perl/Changes
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libjson-perl/Changes?rev=63058&op=diff
==============================================================================
--- trunk/libjson-perl/Changes (original)
+++ trunk/libjson-perl/Changes Tue Sep 28 19:48:55 2010
@@ -15,6 +15,27 @@
 
  !! Since 2.16, PP's relaxed option caused an infinite loop in some condition.
  !! Recommend to update old versions.
+
+2.26  Tue Sep 28 17:41:37 2010
+	[JSON::PP]
+	- cleaned up code and enhanced sort option efficiency in encode.
+
+2.25  Tue Sep 28 16:47:08 2010
+	[JSON]
+	- JSON::Backend::XS::Supportable always executed a needless process
+	    with JSON::XS backend. This made encode/decode a bit slower.
+
+2.24  Mon Sep 27 10:56:24 2010
+	[JSON::PP]
+	- tweaked code.
+	- optimized code in hash object encoding.
+
+2.23  Sun Sep 26 22:08:12 2010
+	[JSON::PP]
+	- modified tied object handling in encode. it made encoding speed faster.
+	    pointed by https://rt.cpan.org/Ticket/Display.html?id=61604
+	- modified t/e10_bignum.t
+            for avoiding a warning in using Math::BigInt dev version
 
 2.22  Wed Aug 25 12:46:13 2010
 	[JSON]

Modified: trunk/libjson-perl/MANIFEST
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libjson-perl/MANIFEST?rev=63058&op=diff
==============================================================================
--- trunk/libjson-perl/MANIFEST (original)
+++ trunk/libjson-perl/MANIFEST Tue Sep 28 19:48:55 2010
@@ -50,6 +50,7 @@
 t/e12_upgrade.t
 t/e13_overloaded_eq.t
 t/e14_decode_prefix.t
+t/e15_tie_ixhash.t
 t/x00_load.t
 t/x02_error.t
 t/x12_blessed.t
@@ -63,3 +64,5 @@
 t/xe10_bignum.t
 t/xe11_conv_blessed_univ.t
 t/xe12_boolean.t
+t/xe19_xs_and_suportbypp.t
+t/xe20_croak_message.t

Modified: trunk/libjson-perl/META.yml
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libjson-perl/META.yml?rev=63058&op=diff
==============================================================================
--- trunk/libjson-perl/META.yml (original)
+++ trunk/libjson-perl/META.yml Tue Sep 28 19:48:55 2010
@@ -1,6 +1,6 @@
 --- #YAML:1.0
 name:               JSON
-version:            2.22
+version:            2.26
 abstract:           JSON (JavaScript Object Notation) encoder/decoder
 author:
     - Makamaka Hannyaharamitu, E<lt>makamaka[at]cpan.orgE<gt>

Modified: trunk/libjson-perl/README
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libjson-perl/README?rev=63058&op=diff
==============================================================================
--- trunk/libjson-perl/README (original)
+++ trunk/libjson-perl/README Tue Sep 28 19:48:55 2010
@@ -1,4 +1,4 @@
-JSON version 2.21
+JSON version 2.26
 =================
 
 INSTALLATION
@@ -45,7 +45,7 @@
      # recommend to use (en|de)code_json.
  
 VERSION
-        2.22
+        2.26
 
     This version is compatible with JSON::XS 2.27 and later.
 

Modified: trunk/libjson-perl/debian/changelog
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libjson-perl/debian/changelog?rev=63058&op=diff
==============================================================================
--- trunk/libjson-perl/debian/changelog (original)
+++ trunk/libjson-perl/debian/changelog Tue Sep 28 19:48:55 2010
@@ -1,3 +1,11 @@
+libjson-perl (2.26-1) unstable; urgency=low
+
+  * New upstream release
+  * debian/copyright: Update license information
+  * debian/libjson-perl.examples: Add example files
+
+ -- Angel Abad <angelabad at gmail.com>  Tue, 28 Sep 2010 21:48:33 +0200
+
 libjson-perl (2.22-1) unstable; urgency=low
 
   * New upstream release.

Modified: trunk/libjson-perl/debian/copyright
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libjson-perl/debian/copyright?rev=63058&op=diff
==============================================================================
--- trunk/libjson-perl/debian/copyright (original)
+++ trunk/libjson-perl/debian/copyright Tue Sep 28 19:48:55 2010
@@ -5,7 +5,6 @@
 
 Files: *
 Copyright: 2005-2010, Makamaka Hannyaharamitu <makamaka at cpan.org>
-License-Alias: Perl
 License: Artistic or GPL-1+
 
 Files: debian/*
@@ -21,7 +20,7 @@
  This program is free software; you can redistribute it and/or modify
  it under the terms of the Artistic License, which comes with Perl.
  .
- On Debian systems, the complete text of the Artistic License
+ On Debian GNU/Linux systems, the complete text of the Artistic License
  can be found in `/usr/share/common-licenses/Artistic'.
 
 License: GPL-1+
@@ -30,5 +29,5 @@
  the Free Software Foundation; either version 1, or (at your option)
  any later version.
  .
- On Debian systems, the complete text of version 1 of the GNU General
- Public License can be found in `/usr/share/common-licenses/GPL-1'.
+ On Debian GNU/Linux systems, the complete text of version 1 of the
+ General Public License can be found in `/usr/share/common-licenses/GPL-1'.

Added: trunk/libjson-perl/debian/libjson-perl.examples
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libjson-perl/debian/libjson-perl.examples?rev=63058&op=file
==============================================================================
--- trunk/libjson-perl/debian/libjson-perl.examples (added)
+++ trunk/libjson-perl/debian/libjson-perl.examples Tue Sep 28 19:48:55 2010
@@ -1,0 +1,1 @@
+eg/*

Modified: trunk/libjson-perl/lib/JSON.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libjson-perl/lib/JSON.pm?rev=63058&op=diff
==============================================================================
--- trunk/libjson-perl/lib/JSON.pm (original)
+++ trunk/libjson-perl/lib/JSON.pm Tue Sep 28 19:48:55 2010
@@ -7,7 +7,7 @@
 @JSON::EXPORT = qw(from_json to_json jsonToObj objToJson encode_json decode_json);
 
 BEGIN {
-    $JSON::VERSION = '2.22';
+    $JSON::VERSION = '2.26';
     $JSON::DEBUG   = 0 unless (defined $JSON::DEBUG);
 }
 
@@ -411,6 +411,18 @@
     local $^W;
     no strict qw(refs);
 
+    my $JSON_XS_encode_orignal     = \&JSON::XS::encode;
+    my $JSON_XS_decode_orignal     = \&JSON::XS::decode;
+    my $JSON_XS_incr_parse_orignal = \&JSON::XS::incr_parse;
+
+    *JSON::XS::decode     = \&JSON::Backend::XS::Supportable::_decode;
+    *JSON::XS::encode     = \&JSON::Backend::XS::Supportable::_encode;
+    *JSON::XS::incr_parse = \&JSON::Backend::XS::Supportable::_incr_parse;
+
+    *{JSON::XS::_original_decode}     = $JSON_XS_decode_orignal;
+    *{JSON::XS::_original_encode}     = $JSON_XS_encode_orignal;
+    *{JSON::XS::_original_incr_parse} = $JSON_XS_incr_parse_orignal;
+
     push @JSON::Backend::XS::Supportable::ISA, 'JSON';
 
     my $pkg = 'JSON::Backend::XS::Supportable';
@@ -447,21 +459,6 @@
 #
 
 package JSON::Backend::XS::Supportable;
-
-{
-    my $JSON_XS_encode_orignal = \&JSON::XS::encode;
-    my $JSON_XS_decode_orignal = \&JSON::XS::decode;
-    my $JSON_XS_incr_parse_orignal = \&JSON::XS::incr_parse;
-
-    local $^W;
-    *JSON::XS::decode = \&JSON::Backend::XS::Supportable::_decode;
-    *JSON::XS::encode = \&JSON::Backend::XS::Supportable::_encode;
-    *JSON::XS::incr_parse = \&JSON::Backend::XS::Supportable::_incr_parse;
-
-    *{JSON::XS::_original_decode} = $JSON_XS_decode_orignal;
-    *{JSON::XS::_original_encode} = $JSON_XS_encode_orignal;
-    *{JSON::XS::_original_incr_parse} = $JSON_XS_incr_parse_orignal;
-}
 
 $Carp::Internal{'JSON::Backend::XS::Supportable'} = 1;
 
@@ -614,7 +611,7 @@
  
 =head1 VERSION
 
-    2.22
+    2.26
 
 This version is compatible with JSON::XS B<2.27> and later.
 

Modified: trunk/libjson-perl/lib/JSON/PP.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libjson-perl/lib/JSON/PP.pm?rev=63058&op=diff
==============================================================================
--- trunk/libjson-perl/lib/JSON/PP.pm (original)
+++ trunk/libjson-perl/lib/JSON/PP.pm Tue Sep 28 19:48:55 2010
@@ -11,7 +11,7 @@
 use B ();
 #use Devel::Peek;
 
-$JSON::PP::VERSION = '2.27004';
+$JSON::PP::VERSION = '2.27007';
 
 @JSON::PP::EXPORT = qw(encode_json decode_json from_json to_json);
 
@@ -40,6 +40,8 @@
 
 use constant P_ALLOW_UNKNOWN        => 18;
 
+use constant OLD_PERL => $] < 5.008 ? 1 : 0;
+
 BEGIN {
     my @xs_compati_bit_properties = qw(
             latin1 ascii utf8 indent canonical space_before space_after allow_nonref shrink
@@ -356,8 +358,7 @@
 
     sub hash_to_json {
         my ($self, $obj) = @_;
-        my ($k,$v);
-        my %res;
+        my @res;
 
         encode_error("json text or perl structure exceeds maximum nesting level (max_depth set too low?)")
                                          if (++$depth > $max_depth);
@@ -365,34 +366,17 @@
         my ($pre, $post) = $indent ? $self->_up_indent() : ('', '');
         my $del = ($space_before ? ' ' : '') . ':' . ($space_after ? ' ' : '');
 
-        if ( my $tie_class = tied %$obj ) {
-            if ( $tie_class->can('TIEHASH') ) {
-                $tie_class =~ s/=.+$//;
-                tie %res, $tie_class;
-            }
-        }
-
-        # In the old Perl verions, tied hashes in bool context didn't work.
-        # So, we can't use such a way (%res ? a : b)
-        my $has;
-
-        for my $k (keys %$obj) {
-            my $v = $obj->{$k};
-            $res{$k} = $self->object_to_json($v) || $self->value_to_json($v);
-            $has = 1 unless ( $has );
+        for my $k ( _sort( $obj ) ) {
+            if ( OLD_PERL ) { utf8::decode($k) } # key for Perl 5.6 / be optimized
+            push @res, string_to_json( $self, $k )
+                          .  $del
+                          . ( $self->object_to_json( $obj->{$k} ) || $self->value_to_json( $obj->{$k} ) );
         }
 
         --$depth;
         $self->_down_indent() if ($indent);
 
-        return '{' . ( $has ? $pre : '' )                                                   # indent
-                   . ( $has ? join(",$pre", map { utf8::decode($_) if ($] < 5.008);         # key for Perl 5.6
-                                                string_to_json($self, $_) . $del . $res{$_} # key : value
-                                            } _sort( $self, \%res )
-                             ) . $post                                                      # indent
-                           : ''
-                     )
-             . '}';
+        return   '{' . ( @res ? $pre : '' ) . ( @res ? join( ",$pre", @res ) . $post : '' )  . '}';
     }
 
 
@@ -404,13 +388,6 @@
                                          if (++$depth > $max_depth);
 
         my ($pre, $post) = $indent ? $self->_up_indent() : ('', '');
-
-        if (my $tie_class = tied @$obj) {
-            if ( $tie_class->can('TIEARRAY') ) {
-                $tie_class =~ s/=.+$//;
-                tie @res, $tie_class;
-            }
-        }
 
         for my $v (@$obj){
             push @res, $self->object_to_json($v) || $self->value_to_json($v);
@@ -535,8 +512,7 @@
 
 
     sub _sort {
-        my ($self, $res) = @_;
-        defined $keysort ? (sort $keysort (keys %$res)) : keys %$res;
+        defined $keysort ? (sort $keysort (keys %{$_[0]})) : keys %{$_[0]};
     }
 
 

Modified: trunk/libjson-perl/t/e10_bignum.t
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libjson-perl/t/e10_bignum.t?rev=63058&op=diff
==============================================================================
--- trunk/libjson-perl/t/e10_bignum.t (original)
+++ trunk/libjson-perl/t/e10_bignum.t Tue Sep 28 19:48:55 2010
@@ -12,8 +12,11 @@
 SKIP: {
     skip "Can't load Math::BigInt.", 6 if ($@);
 
-my $fix =  !Math::BigInt->VERSION       ? '+'
-          : Math::BigInt->VERSION < 1.6 ? '+'
+    my $v = Math::BigInt->VERSION;
+    $v =~ s/_.+$// if $v;
+
+my $fix =  !$v       ? '+'
+          : $v < 1.6 ? '+'
           : '';
 
 




More information about the Pkg-perl-cvs-commits mailing list