def specs(gem_names, source)
index = Index.new
use_full_source_index = !gem_names || @remote_uri.scheme == "file" || Bundler::Fetcher.disable_endpoint
if gem_names && use_api
specs = fetch_remote_specs(gem_names)
end
if specs.nil?
@use_api = false
specs = Bundler::Retry.new("source fetch").attempts do
fetch_all_remote_specs
end
end
specs[@remote_uri].each do |name, version, platform, dependencies|
next if name == 'bundler'
spec = nil
if dependencies
spec = EndpointSpecification.new(name, version, platform, dependencies)
else
spec = RemoteSpecification.new(name, version, platform, self)
end
spec.source = source
spec.source_uri = @remote_uri
index << spec
end
index
rescue CertificateFailureError => e
Bundler.ui.info "" if gem_names && use_api
raise e
end