[前][次][番号順一覧][スレッド一覧]

ruby-changes:34490

From: hsbt <ko1@a...>
Date: Fri, 27 Jun 2014 12:36:14 +0900 (JST)
Subject: [ruby-changes:34490] hsbt:r46571 (trunk): * lib/rubygems/specification.rb: fixed broken condition caused

hsbt	2014-06-27 12:35:51 +0900 (Fri, 27 Jun 2014)

  New Revision: 46571

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=46571

  Log:
    * lib/rubygems/specification.rb: fixed broken condition caused
      by removing YAML::ENGINE.
    * lib/rubygems/package/old.rb: ditto.

  Modified files:
    trunk/ChangeLog
    trunk/lib/rubygems/package/old.rb
    trunk/lib/rubygems/specification.rb
Index: ChangeLog
===================================================================
--- ChangeLog	(revision 46570)
+++ ChangeLog	(revision 46571)
@@ -1,3 +1,9 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1
+Fri Jun 27 12:29:37 2014  SHIBATA Hiroshi  <shibata.hiroshi@g...>
+
+	* 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@r...>
 
 	* hash.c (env_shift): fix memory leak on Windows, free environment
Index: lib/rubygems/specification.rb
===================================================================
--- lib/rubygems/specification.rb	(revision 46570)
+++ lib/rubygems/specification.rb	(revision 46571)
@@ -2359,7 +2359,8 @@ class Gem::Specification < Gem::BasicSpe https://github.com/ruby/ruby/blob/trunk/lib/rubygems/specification.rb#L2359
   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.
Index: lib/rubygems/package/old.rb
===================================================================
--- lib/rubygems/package/old.rb	(revision 46570)
+++ lib/rubygems/package/old.rb	(revision 46571)
@@ -145,7 +145,7 @@ class Gem::Package::Old < Gem::Package https://github.com/ruby/ruby/blob/trunk/lib/rubygems/package/old.rb#L145
 
     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

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]