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

ruby-changes:19722

From: yugui <ko1@a...>
Date: Sun, 29 May 2011 08:31:27 +0900 (JST)
Subject: [ruby-changes:19722] yugui:r31767 (ruby_1_9_2): merges a part of r30931 from trunk into ruby_1_9_2.

yugui	2011-05-29 08:31:16 +0900 (Sun, 29 May 2011)

  New Revision: 31767

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

  Log:
    merges a part of r30931 from trunk into ruby_1_9_2.
    --
    * 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.

  Modified files:
    branches/ruby_1_9_2/ChangeLog
    branches/ruby_1_9_2/ext/psych/lib/psych/json/tree_builder.rb
    branches/ruby_1_9_2/test/psych/test_json_tree.rb
    branches/ruby_1_9_2/version.h

Index: ruby_1_9_2/ChangeLog
===================================================================
--- ruby_1_9_2/ChangeLog	(revision 31766)
+++ ruby_1_9_2/ChangeLog	(revision 31767)
@@ -1,3 +1,12 @@
+Mon Feb 21 10:54:29 2011  Aaron Patterson <aaron@t...>
+
+	* 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  <nobu@r...>
 
 	* thread.c (exec_recursive): prevent temporary objects from GC.
Index: ruby_1_9_2/ext/psych/lib/psych/json/tree_builder.rb
===================================================================
--- ruby_1_9_2/ext/psych/lib/psych/json/tree_builder.rb	(revision 31766)
+++ ruby_1_9_2/ext/psych/lib/psych/json/tree_builder.rb	(revision 31767)
@@ -17,7 +17,7 @@
       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
Index: ruby_1_9_2/version.h
===================================================================
--- ruby_1_9_2/version.h	(revision 31766)
+++ ruby_1_9_2/version.h	(revision 31767)
@@ -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
Index: ruby_1_9_2/test/psych/test_json_tree.rb
===================================================================
--- ruby_1_9_2/test/psych/test_json_tree.rb	(revision 31766)
+++ ruby_1_9_2/test/psych/test_json_tree.rb	(revision 31767)
@@ -31,6 +31,17 @@
       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)

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

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