mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
[rubygems/rubygems] Improve readability by splitting updating the cache and searching it
https://github.com/rubygems/rubygems/commit/d0df25bb0f
This commit is contained in:
parent
f7f85c1feb
commit
7073870dfa
1 changed files with 4 additions and 1 deletions
|
@ -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
|
||||
|
||||
|
|
Loading…
Reference in a new issue