diff options
author | tenderlove <tenderlove@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2010-03-31 21:09:58 +0000 |
---|---|---|
committer | tenderlove <tenderlove@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2010-03-31 21:09:58 +0000 |
commit | a4dbc2ea1020a0a393a0134cc900397a895a88e7 (patch) | |
tree | 93d9e2fd0f71104982884e31ea661d7d8d9504bd /ext/psych/lib/psych.rb | |
parent | c97f5f514a63f2b5ed909aec270e89efb0c2703d (diff) |
* ext/psych/lib/psych.rb: Syck api compatibility [ruby-core:29157]
* ext/psych/lib/psych/nodes/node.rb: ditto
* test/psych/test_psych.rb: ditto
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27134 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext/psych/lib/psych.rb')
-rw-r--r-- | ext/psych/lib/psych.rb | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/ext/psych/lib/psych.rb b/ext/psych/lib/psych.rb index 59307e3d99..9b4b215b67 100644 --- a/ext/psych/lib/psych.rb +++ b/ext/psych/lib/psych.rb @@ -153,10 +153,15 @@ module Psych # Example: # # Psych.dump(['a', 'b']) # => "---\n- a\n- b\n" - def self.dump o, options = {} + def self.dump o, io = nil, options = {} + if Hash === io + options = io + io = nil + end + visitor = Psych::Visitors::YAMLTree.new options visitor << o - visitor.tree.to_yaml + visitor.tree.to_yaml io end ### |