diff options
author | Aaron Patterson <aaron.patterson@gmail.com> | 2014-08-29 14:03:18 -0700 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2014-08-29 14:03:18 -0700 |
commit | 08092b0f089f914388bfdf4775fb260a80ef7361 (patch) | |
tree | 2e5d64942027fb8aa860592a9e3456c176231e65 /lib/psych/visitors/yaml_tree.rb | |
parent | de391773646546deb81f9ed0dabaa9c828356f98 (diff) | |
download | psych-08092b0f089f914388bfdf4775fb260a80ef7361.zip |
* ext/psych/lib/psych/visitors/to_ruby.rb: quoted "<<" strings
should not be treated as merge keys.
* ext/psych/lib/psych/visitors/yaml_tree.rb: hashes with keys
containing "<<" should roundtrip.
* test/psych/test_merge_keys.rb: test for change. Fixes GH #203
fixes #203
Diffstat (limited to 'lib/psych/visitors/yaml_tree.rb')
-rw-r--r-- | lib/psych/visitors/yaml_tree.rb | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/psych/visitors/yaml_tree.rb b/lib/psych/visitors/yaml_tree.rb index 2afedb7..d73d91a 100644 --- a/lib/psych/visitors/yaml_tree.rb +++ b/lib/psych/visitors/yaml_tree.rb @@ -291,6 +291,11 @@ module Psych quote = false elsif o =~ /\n/ style = Nodes::Scalar::LITERAL + elsif o == '<<' + style = Nodes::Scalar::SINGLE_QUOTED + tag = 'tag:yaml.org,2002:str' + plain = false + quote = false elsif o =~ /^\W[^"]*$/ style = Nodes::Scalar::DOUBLE_QUOTED else |