summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog5
-rw-r--r--NEWS4
-rw-r--r--lib/yaml.rb8
3 files changed, 17 insertions, 0 deletions
diff --git a/ChangeLog b/ChangeLog
index bd0cc12ec9..6b5d40533c 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -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
diff --git a/NEWS b/NEWS
index a413c3256e..41df6f5490 100644
--- a/NEWS
+++ b/NEWS
@@ -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