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

* lib/rubygems/specification.rb: fixed broken condition caused

by removing YAML::ENGINE.
* lib/rubygems/package/old.rb: ditto.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46571 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
hsbt 2014-06-27 03:35:51 +00:00
parent 68bc5ba1b6
commit b0bc563550
3 changed files with 9 additions and 2 deletions

View file

@ -1,3 +1,9 @@
Fri Jun 27 12:29:37 2014 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
* lib/rubygems/specification.rb: fixed broken condition caused
by removing YAML::ENGINE.
* lib/rubygems/package/old.rb: ditto.
Fri Jun 27 05:33:26 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
* hash.c (env_shift): fix memory leak on Windows, free environment

View file

@ -145,7 +145,7 @@ class Gem::Package::Old < Gem::Package
yaml_error = if RUBY_VERSION < '1.9' then
YAML::ParseError
elsif YAML::ENGINE.yamler == 'syck' then
elsif YAML.const_defined?(:ENGINE) && YAML::ENGINE.yamler == 'syck' then
YAML::ParseError
else
YAML::SyntaxError

View file

@ -2359,7 +2359,8 @@ class Gem::Specification < Gem::BasicSpecification
end
def to_yaml(opts = {}) # :nodoc:
if YAML.const_defined?(:ENGINE) && !YAML::ENGINE.syck? then
if (YAML.const_defined?(:ENGINE) && !YAML::ENGINE.syck?) ||
(defined?(Psych) && YAML == Psych) then
# Because the user can switch the YAML engine behind our
# back, we have to check again here to make sure that our
# psych code was properly loaded, and load it if not.