diff --git a/ChangeLog b/ChangeLog index 51ef23795a..f836d4144b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +Mon Feb 21 10:54:29 2011 Aaron Patterson + + * ext/psych/lib/psych/json/stream.rb: do not emit custom tags in maps + or sequences when emitting JSON. + * ext/psych/lib/psych/json/tree_builder.rb: do not emit custom tags in + sequences when emitting JSON. + * test/psych/json/test_stream.rb: tests for custom stream emits. + * test/psych/test_json_tree.rb: tests for JSON emits. + Sun Feb 20 16:26:45 2011 Nobuyoshi Nakada * thread.c (exec_recursive): prevent temporary objects from GC. diff --git a/ext/psych/lib/psych/json/tree_builder.rb b/ext/psych/lib/psych/json/tree_builder.rb index 722f2a6bf1..12e0625866 100644 --- a/ext/psych/lib/psych/json/tree_builder.rb +++ b/ext/psych/lib/psych/json/tree_builder.rb @@ -17,7 +17,7 @@ module Psych end def start_sequence anchor, tag, implicit, style - super(anchor, tag, implicit, Nodes::Sequence::FLOW) + super(anchor, nil, implicit, Nodes::Sequence::FLOW) end end end diff --git a/test/psych/test_json_tree.rb b/test/psych/test_json_tree.rb index 96e17be961..590482c0bb 100644 --- a/test/psych/test_json_tree.rb +++ b/test/psych/test_json_tree.rb @@ -31,6 +31,17 @@ module Psych assert_match(/['"]two['"]/, json) end + class Bar + def encode_with coder + coder.represent_seq 'omg', %w{ a b c } + end + end + + def test_json_list_dump_exclude_tag + json = Psych.to_json Bar.new + refute_match('omg', json) + end + def test_list_to_json list = %w{ one two } json = Psych.to_json(list) diff --git a/version.h b/version.h index 1bfba1fd52..84dcb43df6 100644 --- a/version.h +++ b/version.h @@ -1,5 +1,5 @@ #define RUBY_VERSION "1.9.2" -#define RUBY_PATCHLEVEL 205 +#define RUBY_PATCHLEVEL 206 #define RUBY_VERSION_MAJOR 1 #define RUBY_VERSION_MINOR 9 #define RUBY_VERSION_TEENY 1