Skip to content

Commit

Permalink
from the Changes:
Browse files Browse the repository at this point in the history
1.15	2008-01-02
		* Update the config params for JSON and JSON/XS configuration
		* Update JSON handler to always pass in the -support_by_pp option 
		  if you don't want support_by_pp then don't use JSON.pm ...
  • Loading branch information
perigrin committed Jan 2, 2008
1 parent 4d495a6 commit f2102ff
Show file tree
Hide file tree
Showing 3 changed files with 65 additions and 43 deletions.
57 changes: 30 additions & 27 deletions Changes
Original file line number Diff line number Diff line change
@@ -1,7 +1,13 @@
Revision history for JSON-Any
1.14 ???
1.15 2008-01-02
* Update the config params for JSON and JSON/XS configuration
* Update JSON handler to always pass in the -support_by_pp option
if you don't want support_by_pp then don't use JSON.pm ...

1.14 2007-12-20
* Fix for the new JSON/JSON::XS 2.0
*** THIS UPGRADE WILL ONLY WORK ON 2.0+ VERSIONS OF THESE MODULES ***

1.13 2007-11-06
* Fix 10_unicode.t to skip_all if no supported unicode backend is found
(reported by Andreas K�nig)
Expand All @@ -10,43 +16,40 @@ Revision history for JSON-Any
* Fix issue with 05-JSON-Syck.t so we can pass our tests again

1.11 17 Oct 2007
* fix issue with JSON::Syck when using Object API as reported by Miyagawa
* fix issue with JSON::Syck when using Object API as reported by Miyagawa

1.10 12 Oct 2007
* fix issues from http://rt.cpan.org/Public/Bug/Display.html?id=29917
* fix issues from http://rt.cpan.org/Public/Bug/Display.html?id=29917

1.09 10 Oct 2007
* also test for is_utf8() - nothingmuch
* improve unicode test - nothingmuch
* add utf8 support for JSON::{Converter,Parser} - nothingmuch
* Add a test for unicode strings - nothingmuch
* also test for is_utf8() - nothingmuch
* improve unicode test - nothingmuch
* add utf8 support for JSON::{Converter,Parser} - nothingmuch
* Add a test for unicode strings - nothingmuch

1.08 18 May 2007

* Fix Packaging
* Fix JSON.pm backend tests
* fix issues with JSON::XS being pedantic about how it's methods/functions are called
* added a carp requirement
* Fix Packaging
* Fix JSON.pm backend tests
* fix issues with JSON::XS being pedantic about how it's methods/functions are called
* added a carp requirement

1.07 ???

* changed Makefile.PL to Module::Install
* helps if I test 04-ENV.t against the code it was designed for
* skip all 04-ENV.t until I get it working
* fixing tests
* change to skip_all based skippage
* add example directory
* pod updates
* changed Makefile.PL to Module::Install
* helps if I test 04-ENV.t against the code it was designed for
* skip all 04-ENV.t until I get it working
* fixing tests
* change to skip_all based skippage
* add example directory
* pod updates

1.06 ???

* cleaned up t/04-ENV.t to not require JSON::XS anymore
* fixed split on uninitalized value error
* cleaned up JSON-XS tests a bit
* added 04-ENV.t to MANIFEST
* cleaned up t/04-ENV.t to not require JSON::XS anymore
* fixed split on uninitalized value error
* cleaned up JSON-XS tests a bit
* added 04-ENV.t to MANIFEST

... History is Elusive ...

1.00 Fri Mar 23 10:24:50 EDT 2007
* Initial Release
* Currently only supports objToJson and jsonToObj
* Initial Release
* Currently only supports objToJson and jsonToObj
2 changes: 1 addition & 1 deletion Makefile.PL
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ requires 'Carp' => '0';

feature 'JSON',
-default => 1,
'JSON' => '2.01';
'JSON' => '2.02';

feature 'JSON::XS',
-default => 0,
Expand Down
49 changes: 34 additions & 15 deletions lib/JSON/Any.pm
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
##############################################################################
# JSON::Any
# v1.14
# v1.15
# Copyright (c) 2007 Chris Thompson
##############################################################################

Expand All @@ -16,11 +16,11 @@ JSON::Any - Wrapper Class for the various JSON classes.
=head1 VERSION
Version 1.14
Version 1.15
=cut

our $VERSION = '1.14';
our $VERSION = '1.15';

our $UTF8;

Expand All @@ -38,28 +38,41 @@ BEGIN {
create_object => sub {
require utf8;
utf8->import();

JSON->import( '-support_by_pp', '-no_export' );
my ( $self, $conf ) = @_;
my @params = qw(
autoconv
skipinvalid
execcoderef
ascii
latin1
utf8
pretty
indent
delimiter
keysort
convblessed
selfconvert
singlequote
utf8
space_before
space_after
relaxed
canonical
allow_nonref
allow_blessed
convert_blessed
filter_json_object
shrink
max_depth
max_size
loose
allow_bignum
allow_barekey
allow_singlequote
escape_slash
indent_length
sort_by
);
local $conf->{utf8} = !$conf->{utf8}; # it means the opposite
local $conf->{utf8} = !$conf->{utf8}; # it means the opposite
my $obj = $handler->new;

for my $mutator (@params) {
next unless exists $conf->{$mutator};
$obj = $obj->$mutator( $conf->{$mutator} );
}

$self->[ENCODER] = 'encode';
$self->[DECODER] = 'decode';
$self->[HANDLER] = $obj;
Expand Down Expand Up @@ -90,15 +103,21 @@ BEGIN {

my @params = qw(
ascii
latin1
utf8
pretty
indent
space_before
space_after
relaxed
canonical
allow_nonref
allow_blessed
convert_blessed
filter_json_object
shrink
max_depth
max_size
);

local $conf->{utf8} = !$conf->{utf8}; # it means the opposite
Expand Down

0 comments on commit f2102ff

Please sign in to comment.