diff options
author | naruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2014-05-25 03:33:22 +0000 |
---|---|---|
committer | naruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2014-05-25 03:33:22 +0000 |
commit | a95be81ea20816d933d5ef1efccdf9d1b71bfe03 (patch) | |
tree | 14d4a76b52d2803000a3c18d224b44e7c281c93a /lib | |
parent | ecb837865122577bfb43de55a422599d928d22c2 (diff) | |
download | ruby-a95be81ea20816d933d5ef1efccdf9d1b71bfe03.tar.gz |
Revert "* lib/yaml.rb: Remove Psych::EngineManager [Bug #8344]"
zzak is not the maintainer of yaml.
This reverts commit r46097.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46102 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib')
-rw-r--r-- | lib/yaml.rb | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/lib/yaml.rb b/lib/yaml.rb index c0ffcf877b..3b4e4234f7 100644 --- a/lib/yaml.rb +++ b/lib/yaml.rb @@ -12,6 +12,40 @@ end YAML = Psych # :nodoc: +module Psych # :nodoc: + # For compatibility, deprecated + class EngineManager # :nodoc: + attr_reader :yamler # :nodoc: + + def initialize # :nodoc: + @yamler = 'psych' + end + + def syck? # :nodoc: + false + end + + # Psych is always used and this method has no effect. + # + # This method is still present for compatibility. + # + # You may still use the Syck engine by installing + # the 'syck' gem and using the Syck constant. + def yamler= engine # :nodoc: + case engine + when 'syck' then warn "syck has been removed, psych is used instead" + when 'psych' then @yamler = 'psych' + else + raise(ArgumentError, "bad engine") + end + + engine + end + end + + ENGINE = EngineManager.new # :nodoc: +end + # YAML Ain't Markup Language # # This module provides a Ruby interface for data serialization in YAML format. |