diff options
author | Aaron Patterson <aaron.patterson@gmail.com> | 2014-02-28 18:10:39 -0800 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2014-02-28 18:10:39 -0800 |
commit | 960d30ef5ac4ab93db199852fcd93f3cc3dfe1dd (patch) | |
tree | c994e1379c146c60716d59fedd8db8f7f7342723 /lib/psych/visitors/yaml_tree.rb | |
parent | 5e6a486f3c0cde1529e47e4b74816284414762a4 (diff) | |
download | psych-960d30ef5ac4ab93db199852fcd93f3cc3dfe1dd.zip |
* ext/psych/lib/psych/visitors/yaml_tree.rb: support dumping Encoding
objects.
* ext/psych/lib/psych/visitors/to_ruby.rb: support loading Encoding
objects.
* test/psych/test_encoding.rb: add test
* ext/psych/lib/psych.rb: add version
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 f89fcbb..ff0fcd2 100644 --- a/lib/psych/visitors/yaml_tree.rb +++ b/lib/psych/visitors/yaml_tree.rb @@ -157,6 +157,11 @@ module Psych @emitter.end_sequence end + def visit_Encoding o + tag = "!ruby/encoding" + @emitter.scalar o.name, nil, tag, false, false, Nodes::Scalar::ANY + end + def visit_Object o tag = Psych.dump_tags[o.class] unless tag |