aboutsummaryrefslogtreecommitdiffstats
path: root/lib/yaml.rb
diff options
context:
space:
mode:
authorzzak <zzak@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-02-03 17:40:30 +0000
committerzzak <zzak@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-02-03 17:40:30 +0000
commit110a545d3f9161162eb358bd9323accb8b0b135b (patch)
treef3af542c14a991db9eef4ea57ff36d51703d67fa /lib/yaml.rb
parent80455c0d97ccf7dddaaeb871a118e3637760f91f (diff)
downloadruby-110a545d3f9161162eb358bd9323accb8b0b135b.tar.gz
* lib/yaml.rb (YAML::EngineManager): Documentation for #yamler and
#yamler= for using the removed Syck gem as the YAML::ENGINE git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@39033 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/yaml.rb')
-rw-r--r--lib/yaml.rb20
1 files changed, 17 insertions, 3 deletions
diff --git a/lib/yaml.rb b/lib/yaml.rb
index 19df5efc53..93e869cd79 100644
--- a/lib/yaml.rb
+++ b/lib/yaml.rb
@@ -13,17 +13,31 @@ rescue LoadError
end
module Psych
- class EngineManager # :nodoc:
+ class EngineManager
+ # Returns the YAML engine in use.
+ #
+ # By default Psych is used but the old and unmaintained Syck may be chosen.
+ #
+ # See #yamler= for more information.
attr_reader :yamler
- def initialize
+ def initialize # :nodoc:
@yamler = 'psych'
end
- def syck?
+ def syck? # :nodoc:
false
end
+ # By default Psych is used but the old and unmaintained Syck may be chosen.
+ #
+ # After installing the 'syck' gem, you can set the YAML engine to syck:
+ #
+ # YAML::ENGINE.yamler = 'syck'
+ #
+ # To set the YAML engine back to psych:
+ #
+ # YAML::ENGINE.yamler = 'psych'
def yamler= engine
case engine
when 'syck' then warn "syck has been removed"