lib/rubygems/remote_fetcher.rb
##
# Given a name and requirement, downloads this gem into cache and returns the
# filename. Returns nil if the gem cannot be located.
#--
# Should probably be integrated with #download below, but that will be a
# larger, more encompassing effort. -erikh
Given a name and requirement, downloads this gem into cache and returns the
filename. Returns nil if the gem cannot be located.

Should probably be integrated with #download below, but that will be a
larger, more encompassing effort. -erikh
Given a name and requirement downloads this gem into cache and returns the filename . Returns nil if the gem cannot be located . Should probably be integrated with #download below but that will be a larger more encompassing effort . - erikh
def download_to_cache(dependency)
    found, _ = Gem::SpecFetcher.fetcher.spec_for_dependency dependency
    return if found.empty?
    spec, source = found.max_by {|(s,_)| s.version }
    download spec, source.uri
  end
def download_to_cache ( dependency ) found , _ = Gem :: SpecFetcher . fetcher . spec_for_dependency dependency return if found . empty? spec , source = found . max_by { | ( s , _ ) | s . version } download spec , source . uri end
Given a name and requirement, downloads this gem into cache and returns the
filename.
Given a name and requirement downloads this gem into cache and returns the filename .
dependency
<not_specific>