diff --git a/ChangeLog b/ChangeLog index 659df9c954..aecb21a586 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +Fri Jun 27 12:29:37 2014 SHIBATA Hiroshi + + * 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 * hash.c (env_shift): fix memory leak on Windows, free environment diff --git a/lib/rubygems/package/old.rb b/lib/rubygems/package/old.rb index d74753fa90..31c4111d33 100644 --- a/lib/rubygems/package/old.rb +++ b/lib/rubygems/package/old.rb @@ -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 diff --git a/lib/rubygems/specification.rb b/lib/rubygems/specification.rb index f4e609a5eb..d760ab4a83 100644 --- a/lib/rubygems/specification.rb +++ b/lib/rubygems/specification.rb @@ -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.