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

ruby-changes:69429

From: David <ko1@a...>
Date: Mon, 25 Oct 2021 20:55:10 +0900 (JST)
Subject: [ruby-changes:69429] 7073870dfa (master): [rubygems/rubygems] Improve readability by splitting updating the cache and searching it

https://git.ruby-lang.org/ruby.git/commit/?id=7073870dfa

From 7073870dfaa31581b2ff6787224712ad6bdd2f15 Mon Sep 17 00:00:00 2001
From: David Rodriguez <deivid.rodriguez@r...>
Date: Thu, 21 Oct 2021 20:28:02 +0200
Subject: [rubygems/rubygems] Improve readability by splitting updating the
 cache and searching it

https://github.com/rubygems/rubygems/commit/d0df25bb0f
---
 lib/bundler/source/rubygems.rb | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/lib/bundler/source/rubygems.rb b/lib/bundler/source/rubygems.rb
index d0cfb07e18d..11b506b3245 100644
--- a/lib/bundler/source/rubygems.rb
+++ b/lib/bundler/source/rubygems.rb
@@ -357,7 +357,10 @@ module Bundler https://github.com/ruby/ruby/blob/trunk/lib/bundler/source/rubygems.rb#L357
       end
 
       def cached_path(spec)
-        possibilities = (@caches << download_cache_path(spec)).compact.map {|p| "#{p}/#{spec.file_name}" }
+        global_cache_path = download_cache_path(spec)
+        @caches << global_cache_path if global_cache_path
+
+        possibilities = @caches.map {|p| "#{p}/#{spec.file_name}" }
         possibilities.find {|p| File.exist?(p) }
       end
 
-- 
cgit v1.2.1


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

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