diff options
author | David Rodriguez <deivid.rodriguez@riseup.net> | 2021-10-21 20:28:02 +0200 |
---|---|---|
committer | Hiroshi SHIBATA <hsbt@ruby-lang.org> | 2021-10-25 20:48:51 +0900 |
commit | 7073870dfaa31581b2ff6787224712ad6bdd2f15 (patch) | |
tree | 89dc108a33835a492ee7df2c7e9a8c583624b8b7 /lib | |
parent | f7f85c1febd23eec04f78bc461b21ea604a865a9 (diff) |
[rubygems/rubygems] Improve readability by splitting updating the cache and searching it
https://github.com/rubygems/rubygems/commit/d0df25bb0f
Diffstat (limited to 'lib')
-rw-r--r-- | lib/bundler/source/rubygems.rb | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/bundler/source/rubygems.rb b/lib/bundler/source/rubygems.rb index d0cfb07e18..11b506b324 100644 --- a/lib/bundler/source/rubygems.rb +++ b/lib/bundler/source/rubygems.rb @@ -357,7 +357,10 @@ module Bundler 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 |