class Bundler::RubygemsIntegration::Future

def fetch_all_remote_specs

def fetch_all_remote_specs
  tuples, errors = Gem::SpecFetcher.new.available_specs(:complete)
  # only raise if we don't get any specs back.
  # this means we still work if prerelease_specs.4.8.gz
  # don't exist but specs.4.8.gz do
  if tuples.empty? && error = errors.detect {|e| e.is_a?(Gem::SourceFetchProblem) }
    raise Gem::RemoteFetcher::FetchError.new(error.error, error.source)
  end
  hash = {}
  tuples.each do |source,tuples|
    hash[source.uri] = tuples.map { |tuple| tuple.to_a }
  end
  hash
end