class Bundler::Fetcher

def specs(gem_names, source)

return the specs in the bundler format as an index
def specs(gem_names, source)
  index = Bundler::Index.new
  if Bundler::Fetcher.disable_endpoint
    @use_api = false
    specs = fetchers.last.specs(gem_names)
  else
    specs = []
    @fetchers = fetchers.drop_while do |f|
      !f.available? || (f.api_fetcher? && !gem_names) || !specs = f.specs(gem_names)
    end
    @use_api = false if fetchers.none?(&:api_fetcher?)
  end
  specs.each do |name, version, platform, dependencies, metadata|
    spec = if dependencies
      EndpointSpecification.new(name, version, platform, self, dependencies, metadata)
    else
      RemoteSpecification.new(name, version, platform, self)
    end
    spec.source = source
    spec.remote = @remote
    index << spec
  end
  index
rescue CertificateFailureError
  Bundler.ui.info "" if gem_names && use_api # newline after dots
  raise
end