Subject: | Someone requested JSON::Any use $ENV as an alternate source for @order ... this patch implements that |
People using MooseX::Storage don't directly use JSON::Any themselves and
needed a way to set their local preferred ordering. Included is a patch
to add a check for $ENV{JSON_ANY_ORDER} and to set @order properly. Also
attached is a test for this new functionality.
Subject: | 04-ENV.t |
#!/usr/bin/perl -w
use strict;
use Test::More tests => 3;
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');
Subject: | env.patch |
--- /opt/local/lib/perl5/site_perl/5.8.8/JSON/Any.pm 2007-04-24 10:47:14.000000000 -0500
+++ JSON-Any/lib/JSON/Any.pm 2007-05-07 13:53:58.000000000 -0500
@@ -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
+Version 1.05
=cut
-our $VERSION = '1.04';
+our $VERSION = '1.05';
=head1 SYNOPSIS