class Bundler::Source::Rubygems

def remote_specs

def remote_specs
  @remote_specs ||= Index.build do |idx|
    index_fetchers = fetchers - api_fetchers
    # gather lists from non-api sites
    fetch_names(index_fetchers, nil, idx, false)
    # because ensuring we have all the gems we need involves downloading
    # the gemspecs of those gems, if the non-api sites contain more than
    # about 500 gems, we treat all sites as non-api for speed.
    allow_api = idx.size < API_REQUEST_LIMIT && dependency_names.size < API_REQUEST_LIMIT
    Bundler.ui.debug "Need to query more than #{API_REQUEST_LIMIT} gems." \
      " Downloading full index instead..." unless allow_api
    fetch_names(api_fetchers, allow_api && dependency_names, idx, false)
  end
end