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

* lib/yaml.rb: use Psych if only it is loaded already.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27257 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nobu 2010-04-08 02:45:23 +00:00
parent 3a45ac8af1
commit 23d104a161
2 changed files with 6 additions and 2 deletions

View file

@ -1,4 +1,6 @@
Thu Apr 8 11:31:37 2010 Nobuyoshi Nakada <nobu@ruby-lang.org> Thu Apr 8 11:45:14 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
* lib/yaml.rb: use Psych if only it is loaded already.
* lib/yaml.rb (YAML::EngineManager#yamler): set the result after * lib/yaml.rb (YAML::EngineManager#yamler): set the result after
successfully switched. successfully switched.

View file

@ -30,6 +30,8 @@ module YAML
ENGINE = YAML::EngineManager.new ENGINE = YAML::EngineManager.new
end end
engine = (!defined?(Syck) && defined?(Psych) ? 'psych' : 'syck')
module Syck module Syck
ENGINE = YAML::ENGINE ENGINE = YAML::ENGINE
end end
@ -38,4 +40,4 @@ module Psych
ENGINE = YAML::ENGINE ENGINE = YAML::ENGINE
end end
YAML::ENGINE.yamler = 'syck' YAML::ENGINE.yamler = engine