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

ruby-changes:67416

From: David <ko1@a...>
Date: Tue, 31 Aug 2021 19:06:58 +0900 (JST)
Subject: [ruby-changes:67416] 2e850e0038 (master): [rubygems/rubygems] Only set local variable in the branch using it

https://git.ruby-lang.org/ruby.git/commit/?id=2e850e0038

From 2e850e0038e8ba9a5dd3266e9f0f6b2821f19084 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?David=20Rodr=C3=ADguez?= <deivid.rodriguez@r...>
Date: Sat, 31 Jul 2021 13:21:41 +0200
Subject: [rubygems/rubygems] Only set local variable in the branch using it

https://github.com/rubygems/rubygems/commit/9fd39bd5a3
---
 lib/bundler/resolver.rb | 11 +++++------
 1 file changed, 5 insertions(+), 6 deletions(-)

diff --git a/lib/bundler/resolver.rb b/lib/bundler/resolver.rb
index 2cfe25f..0e28e85 100644
--- a/lib/bundler/resolver.rb
+++ b/lib/bundler/resolver.rb
@@ -255,12 +255,6 @@ module Bundler https://github.com/ruby/ruby/blob/trunk/lib/bundler/resolver.rb#L255
         next if name == "bundler"
         next unless search_for(requirement).empty?
 
-        cache_message = begin
-                            " or in gems cached in #{Bundler.settings.app_cache_path}" if Bundler.app_cache.exist?
-                          rescue GemfileNotFound
-                            nil
-                          end
-
         if (base = @base[name]) && !base.empty?
           version = base.first.version
           message = "You have requested:\n" \
@@ -273,6 +267,11 @@ module Bundler https://github.com/ruby/ruby/blob/trunk/lib/bundler/resolver.rb#L267
           source = source_for(name)
           specs = source.specs.search(name)
           versions_with_platforms = specs.map {|s| [s.version, s.platform] }
+          cache_message = begin
+                              " or in gems cached in #{Bundler.settings.app_cache_path}" if Bundler.app_cache.exist?
+                            rescue GemfileNotFound
+                              nil
+                            end
           message = String.new("Could not find gem '#{SharedHelpers.pretty_dependency(requirement)}' in #{source}#{cache_message}.\n")
           message << "The source contains the following versions of '#{name}': #{formatted_versions_with_platforms(versions_with_platforms)}" if versions_with_platforms.any?
         end
-- 
cgit v1.1


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

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