r5360 - in /packages/libjson-any-perl/branches/upstream/current: MANIFEST META.yml README lib/JSON/Any.pm t/04-ENV.t

eloy at users.alioth.debian.org eloy at users.alioth.debian.org
Wed May 9 12:28:53 UTC 2007


Author: eloy
Date: Wed May  9 12:28:52 2007
New Revision: 5360

URL: http://svn.debian.org/wsvn/pkg-perl/?sc=1&rev=5360
Log:
[svn-upgrade] Integrating new upstream version, libjson-any-perl (1.05)

Added:
    packages/libjson-any-perl/branches/upstream/current/t/04-ENV.t
Modified:
    packages/libjson-any-perl/branches/upstream/current/MANIFEST
    packages/libjson-any-perl/branches/upstream/current/META.yml
    packages/libjson-any-perl/branches/upstream/current/README
    packages/libjson-any-perl/branches/upstream/current/lib/JSON/Any.pm

Modified: packages/libjson-any-perl/branches/upstream/current/MANIFEST
URL: http://svn.debian.org/wsvn/pkg-perl/packages/libjson-any-perl/branches/upstream/current/MANIFEST?rev=5360&op=diff
==============================================================================
--- packages/libjson-any-perl/branches/upstream/current/MANIFEST (original)
+++ packages/libjson-any-perl/branches/upstream/current/MANIFEST Wed May  9 12:28:52 2007
@@ -7,3 +7,4 @@
 t/00-load.t
 t/pod-coverage.t
 t/pod.t
+t/04-ENV.t

Modified: packages/libjson-any-perl/branches/upstream/current/META.yml
URL: http://svn.debian.org/wsvn/pkg-perl/packages/libjson-any-perl/branches/upstream/current/META.yml?rev=5360&op=diff
==============================================================================
--- packages/libjson-any-perl/branches/upstream/current/META.yml (original)
+++ packages/libjson-any-perl/branches/upstream/current/META.yml Wed May  9 12:28:52 2007
@@ -1,11 +1,11 @@
 # http://module-build.sourceforge.net/META-spec.html
 #XXXXXXX This is a prototype!!!  It will change in the future!!! XXXXX#
 name:         JSON-Any
-version:      1.04
+version:      1.05
 version_from: lib/JSON/Any.pm
 installdirs:  site
 requires:
     Test::More:                    0
 
 distribution_type: module
-generated_by: ExtUtils::MakeMaker version 6.17
+generated_by: ExtUtils::MakeMaker version 6.30_01

Modified: packages/libjson-any-perl/branches/upstream/current/README
URL: http://svn.debian.org/wsvn/pkg-perl/packages/libjson-any-perl/branches/upstream/current/README?rev=5360&op=diff
==============================================================================
--- packages/libjson-any-perl/branches/upstream/current/README (original)
+++ packages/libjson-any-perl/branches/upstream/current/README Wed May  9 12:28:52 2007
@@ -2,7 +2,7 @@
     JSON::Any - Wrapper Class for the various JSON classes.
 
 VERSION
-    Version 1.04
+    Version 1.05
 
 SYNOPSIS
     This module will provide a coherent API to bring together the various

Modified: packages/libjson-any-perl/branches/upstream/current/lib/JSON/Any.pm
URL: http://svn.debian.org/wsvn/pkg-perl/packages/libjson-any-perl/branches/upstream/current/lib/JSON/Any.pm?rev=5360&op=diff
==============================================================================
--- packages/libjson-any-perl/branches/upstream/current/lib/JSON/Any.pm (original)
+++ packages/libjson-any-perl/branches/upstream/current/lib/JSON/Any.pm Wed May  9 12:28:52 2007
@@ -1,6 +1,6 @@
 ##############################################################################
 # JSON::Any
-# v1.04
+# v1.05
 # Copyright (c) 2007 Chris Thompson
 ##############################################################################
 
@@ -90,6 +90,7 @@
 
     ( $handler, $encoder, $decoder ) = ();
 
+    @order = split /\s/, $ENV{JSON_ANY_ORDER} unless @order;
     @order = qw(XS JSON DWIW Syck) unless @order;
 
     foreach my $testmod (@order) {
@@ -115,11 +116,11 @@
 
 =head1 VERSION
 
-Version 1.04
-
-=cut
-
-our $VERSION = '1.04';
+Version 1.05
+
+=cut
+
+our $VERSION = '1.05';
 
 =head1 SYNOPSIS
 
@@ -194,7 +195,9 @@
     my $self  = bless [], $class;
     ( my $key = lc($handler) ) =~ s/::/_/g;
     if ( my $creator = $conf{$key}->{create_object} ) {
-        $self->[0] = $creator->({@_});
+        my @config = @_;
+        push @config, map { split /=/, $_  } split /,\s*/, $ENV{JSON_ANY_CONFIG};
+        $self->[0] = $creator->({@config});
     }
     return $self;
 }

Added: packages/libjson-any-perl/branches/upstream/current/t/04-ENV.t
URL: http://svn.debian.org/wsvn/pkg-perl/packages/libjson-any-perl/branches/upstream/current/t/04-ENV.t?rev=5360&op=file
==============================================================================
--- packages/libjson-any-perl/branches/upstream/current/t/04-ENV.t (added)
+++ packages/libjson-any-perl/branches/upstream/current/t/04-ENV.t Wed May  9 12:28:52 2007
@@ -1,0 +1,26 @@
+#!/usr/bin/perl -w
+
+use strict;
+use Test::More tests => 8;
+
+BEGIN {
+    $ENV{JSON_ANY_ORDER} = qw(JSON);
+}
+use JSON::Any;
+is_deeply( $ENV{JSON_ANY_ORDER}, qw(JSON) );
+is( JSON::Any->handlerType, 'JSON' );
+
+$ENV{JSON_ANY_ORDER} = qw(XS);
+JSON::Any->import();
+is(JSON::Any->handlerType, 'JSON::XS');
+
+my ($json); 
+ok( $json = JSON::Any->new() );
+eval{ $json->encode("ü"), qq["ü"] };
+ok($@, 'trapped a failure');
+undef $@;
+$ENV{JSON_ANY_CONFIG} = 'allow_nonref=1';
+ok( $json = JSON::Any->new() );
+ok($json->encode("ü"), qq["ü"]);
+ok($@ == undef, 'no failure');
+




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