class Bundler::Fetcher

def fetch_remote_specs(gem_names, full_dependency_list = [], last_spec_list = [])

fetch index
def fetch_remote_specs(gem_names, full_dependency_list = [], last_spec_list = [])
  query_list = gem_names - full_dependency_list
  # only display the message on the first run
  if Bundler.ui.debug?
    Bundler.ui.debug "Query List: #{query_list.inspect}"
  else
    Bundler.ui.info ".", false
  end
  return {@remote_uri => last_spec_list} if query_list.empty?
  remote_specs = Bundler::Retry.new("dependency api").attempts do
    fetch_dependency_remote_specs(query_list)
  end
  spec_list, deps_list = remote_specs
  returned_gems = spec_list.map {|spec| spec.first }.uniq
  fetch_remote_specs(deps_list, full_dependency_list + returned_gems, spec_list + last_spec_list)
rescue HTTPError, MarshalError, GemspecError => e
  Bundler.ui.info "" unless Bundler.ui.debug? # new line now that the dots are over
  Bundler.ui.debug "could not fetch from the dependency API, trying the full index"
  @use_api = false
  return nil
end