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

ruby-changes:36904

From: nobu <ko1@a...>
Date: Thu, 25 Dec 2014 12:38:11 +0900 (JST)
Subject: [ruby-changes:36904] nobu:r48985 (trunk): rubygems: fix variable name

nobu	2014-12-25 12:37:54 +0900 (Thu, 25 Dec 2014)

  New Revision: 48985

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

  Log:
    rubygems: fix variable name
    
    * lib/rubygems/compatibility.rb: fix out-of-scope local variable.
    
    * lib/rubygems/specification.rb (Gem::Specification#validate): get
      rid of conflict between a local variable and a method name.

  Modified files:
    trunk/lib/rubygems/compatibility.rb
    trunk/lib/rubygems/specification.rb
Index: lib/rubygems/compatibility.rb
===================================================================
--- lib/rubygems/compatibility.rb	(revision 48984)
+++ lib/rubygems/compatibility.rb	(revision 48985)
@@ -20,8 +20,7 @@ if Gem::GEM_PRELUDE_SUCKAGE and defined? https://github.com/ruby/ruby/blob/trunk/lib/rubygems/compatibility.rb#L20
 
   $LOADED_FEATURES.delete Gem::QuickLoader.path_to_full_rubygems_library
 
-  if $LOADED_FEATURES.any? do |path| path.end_with? '/rubygems.rb' end then
-    # TODO path does not exist here
+  if path = $LOADED_FEATURES.find {|n| n.end_with? '/rubygems.rb'} then
     raise LoadError, "another rubygems is already loaded from #{path}"
   end
 
Index: lib/rubygems/specification.rb
===================================================================
--- lib/rubygems/specification.rb	(revision 48984)
+++ lib/rubygems/specification.rb	(revision 48985)
@@ -2456,8 +2456,8 @@ class Gem::Specification < Gem::BasicSpe https://github.com/ruby/ruby/blob/trunk/lib/rubygems/specification.rb#L2456
     extend Gem::UserInteraction
     normalize
 
-    nil_attributes = self.class.non_nil_attributes.find_all do |name|
-      instance_variable_get("@#{name}").nil?
+    nil_attributes = self.class.non_nil_attributes.find_all do |attrname|
+      instance_variable_get("@#{attrname}").nil?
     end
 
     unless nil_attributes.empty? then

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

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