1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

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.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_9_2@31767 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
yugui 2011-05-28 23:31:16 +00:00
parent b0db8f0bcd
commit 137c52d909
4 changed files with 22 additions and 2 deletions

View file

@ -1,3 +1,12 @@
Mon Feb 21 10:54:29 2011 Aaron Patterson <aaron@tenderlovemaking.com>
* 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@ruby-lang.org>
* thread.c (exec_recursive): prevent temporary objects from GC.

View file

@ -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

View file

@ -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)

View file

@ -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