зеркало из https://github.com/github/ruby.git
* ext/psych/lib/psych/visitors/yaml_tree.rb: fix symbol keys in coder
emission. Thanks @tjwallace * test/psych/test_coder.rb: test for change git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40142 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
Родитель
0cb251e079
Коммит
2a58706e2d
|
@ -1,3 +1,9 @@
|
||||||
|
Sat Apr 6 03:11:07 2013 Aaron Patterson <aaron@tenderlovemaking.com>
|
||||||
|
|
||||||
|
* ext/psych/lib/psych/visitors/yaml_tree.rb: fix symbol keys in coder
|
||||||
|
emission. Thanks @tjwallace
|
||||||
|
* test/psych/test_coder.rb: test for change
|
||||||
|
|
||||||
Sat Apr 6 02:54:08 2013 Aaron Patterson <aaron@tenderlovemaking.com>
|
Sat Apr 6 02:54:08 2013 Aaron Patterson <aaron@tenderlovemaking.com>
|
||||||
|
|
||||||
* ext/psych/lib/psych/exception.rb: there should be only one exception
|
* ext/psych/lib/psych/exception.rb: there should be only one exception
|
||||||
|
|
|
@ -463,7 +463,7 @@ module Psych
|
||||||
when :map
|
when :map
|
||||||
@emitter.start_mapping nil, c.tag, c.implicit, c.style
|
@emitter.start_mapping nil, c.tag, c.implicit, c.style
|
||||||
c.map.each do |k,v|
|
c.map.each do |k,v|
|
||||||
@emitter.scalar k, nil, nil, true, false, Nodes::Scalar::ANY
|
accept k
|
||||||
accept v
|
accept v
|
||||||
end
|
end
|
||||||
@emitter.end_mapping
|
@emitter.end_mapping
|
||||||
|
|
|
@ -85,7 +85,7 @@ module Psych
|
||||||
end
|
end
|
||||||
|
|
||||||
def encode_with coder
|
def encode_with coder
|
||||||
coder.represent_map self.class.name, { 'a' => 'b' }
|
coder.represent_map self.class.name, { "string" => 'a', :symbol => 'b' }
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -131,7 +131,7 @@ module Psych
|
||||||
|
|
||||||
def test_represent_map
|
def test_represent_map
|
||||||
thing = Psych.load(Psych.dump(RepresentWithMap.new))
|
thing = Psych.load(Psych.dump(RepresentWithMap.new))
|
||||||
assert_equal({ 'a' => 'b' }, thing.map)
|
assert_equal({ "string" => 'a', :symbol => 'b' }, thing.map)
|
||||||
end
|
end
|
||||||
|
|
||||||
def test_represent_sequence
|
def test_represent_sequence
|
||||||
|
|
Загрузка…
Ссылка в новой задаче