From 10284a049af43112881d658abacaa32900ed0d0e Mon Sep 17 00:00:00 2001 From: tenderlove Date: Thu, 6 Jan 2011 02:29:18 +0000 Subject: [PATCH] * ext/psych/lib/psych/json/tree_builder.rb (start_mapping): tags should not be included in JSON mapping git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30475 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ChangeLog | 5 +++++ ext/psych/lib/psych/json/tree_builder.rb | 2 +- test/psych/test_coder.rb | 4 ++++ 3 files changed, 10 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 17a0dd6076..6db823fe5c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +Thu Jan 6 11:27:01 2011 Aaron Patterson + + * ext/psych/lib/psych/json/tree_builder.rb (start_mapping): tags + should not be included in JSON mapping + Thu Jan 6 09:23:33 2011 Aaron Patterson * lib/net/protocol.rb (eof?): BufferedIO should proxy eof? to the diff --git a/ext/psych/lib/psych/json/tree_builder.rb b/ext/psych/lib/psych/json/tree_builder.rb index 720ede7e1e..26fcb118d0 100644 --- a/ext/psych/lib/psych/json/tree_builder.rb +++ b/ext/psych/lib/psych/json/tree_builder.rb @@ -13,7 +13,7 @@ module Psych end def start_mapping anchor, tag, implicit, style - super(anchor, tag, implicit, Nodes::Mapping::FLOW) + super(anchor, nil, implicit, Nodes::Mapping::FLOW) end def start_sequence anchor, tag, implicit, style diff --git a/test/psych/test_coder.rb b/test/psych/test_coder.rb index 0fa01ca3b6..c171c5ad0d 100644 --- a/test/psych/test_coder.rb +++ b/test/psych/test_coder.rb @@ -89,6 +89,10 @@ module Psych end end + def test_json_dump_exclude_tag + refute_match('TestCoder::InitApi', Psych.to_json(InitApi.new)) + end + def test_map_takes_block coder = Psych::Coder.new 'foo' tag = coder.tag