[前][次][番号順一覧][スレッド一覧]

ruby-changes:18452

From: tenderlove <ko1@a...>
Date: Thu, 6 Jan 2011 11:29:29 +0900 (JST)
Subject: [ruby-changes:18452] Ruby:r30475 (trunk): * ext/psych/lib/psych/json/tree_builder.rb (start_mapping): tags

tenderlove	2011-01-06 11:29:18 +0900 (Thu, 06 Jan 2011)

  New Revision: 30475

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=30475

  Log:
    * ext/psych/lib/psych/json/tree_builder.rb (start_mapping): tags
      should not be included in JSON mapping

  Modified files:
    trunk/ChangeLog
    trunk/ext/psych/lib/psych/json/tree_builder.rb
    trunk/test/psych/test_coder.rb

Index: ChangeLog
===================================================================
--- ChangeLog	(revision 30474)
+++ ChangeLog	(revision 30475)
@@ -1,3 +1,8 @@
+Thu Jan  6 11:27:01 2011  Aaron Patterson <aaron@t...>
+
+	* 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 <aaron@t...>
 
 	* lib/net/protocol.rb (eof?): BufferedIO should proxy eof? to the
Index: ext/psych/lib/psych/json/tree_builder.rb
===================================================================
--- ext/psych/lib/psych/json/tree_builder.rb	(revision 30474)
+++ ext/psych/lib/psych/json/tree_builder.rb	(revision 30475)
@@ -13,7 +13,7 @@
       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
Index: test/psych/test_coder.rb
===================================================================
--- test/psych/test_coder.rb	(revision 30474)
+++ test/psych/test_coder.rb	(revision 30475)
@@ -89,6 +89,10 @@
       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

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]