diff options
author | tenderlove <tenderlove@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2011-05-23 19:05:47 +0000 |
---|---|---|
committer | tenderlove <tenderlove@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2011-05-23 19:05:47 +0000 |
commit | 4eaf3d4a511611f0a81d2da23ffb72b7641507f3 (patch) | |
tree | 6ad8538abf5a4adc52c364e4c5db79d46e1fdaab | |
parent | 7d20942bf6dd54cf54d12d4c9f9dc86b9a813bb4 (diff) | |
download | ruby-4eaf3d4a511611f0a81d2da23ffb72b7641507f3.tar.gz |
* lib/yaml.rb: switch default YAML engine to Psych, old syck engine
may be enabled via YAML::ENGINE.yamler = "syck". [ruby-core:36374]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31715 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | NEWS | 4 | ||||
-rw-r--r-- | lib/yaml.rb | 8 |
3 files changed, 17 insertions, 0 deletions
@@ -1,3 +1,8 @@ +Tue May 24 04:01:46 2011 Aaron Patterson <aaron@tenderlovemaking.com> + + * lib/yaml.rb: switch default YAML engine to Psych, old syck engine + may be enabled via YAML::ENGINE.yamler = "syck". [ruby-core:36374] + Mon May 23 09:45:26 2011 Hiroshi Nakamura <nahi@ruby-lang.org> * include/ruby/defines.h (CASEFOLD_FILESYSTEM): Revert r30508. Forgot to @@ -149,6 +149,10 @@ with all sufficient information, see the ChangeLog file. * new logging directive: * %{remote}p for remote (client) port number. +* yaml + * The default YAML engine is now Psych. You may downgrade to syck by setting + YAML::ENGINE.yamler = 'syck'. + * zlib * new methods: * Zlib.deflate diff --git a/lib/yaml.rb b/lib/yaml.rb index 9b5a9b2787..dd89a30e3f 100644 --- a/lib/yaml.rb +++ b/lib/yaml.rb @@ -30,6 +30,14 @@ module YAML ENGINE = YAML::EngineManager.new end +begin + require 'psych' +rescue LoadError + warn "#{caller[0]}:" + warn "It seems your ruby installation is missing psych (for YAML output)." + warn "To eliminate this warning, please install libyaml and reinstall your ruby." +end + engine = (!defined?(Syck) && defined?(Psych) ? 'psych' : 'syck') module Syck |