method
specs
v2_6_3 -
Show latest stable
- Class:
Bundler::Fetcher
specs(gem_names, source)public
return the specs in the bundler format as an index
# File lib/bundler/fetcher.rb, line 118
def specs(gem_names, source)
old = Bundler.rubygems.sources
index = Bundler::Index.new
if Bundler::Fetcher.disable_endpoint
@use_api = false
specs = fetchers.last.specs(gem_names)
else
specs = []
fetchers.shift until fetchers.first.available? || fetchers.empty?
fetchers.dup.each do |f|
break unless f.api_fetcher? && !gem_names || !specs = f.specs(gem_names)
fetchers.delete(f)
end
@use_api = false if fetchers.none?(&:api_fetcher?)
end
specs.each do |name, version, platform, dependencies, metadata|
next if name == "bundler"
spec = if dependencies
EndpointSpecification.new(name, version, platform, 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
ensure
Bundler.rubygems.sources = old
end Related methods
- Instance methods
- fetch_spec
- fetchers
- http_proxy
- inspect
- specs
- specs_with_retry
- uri
- use_api
- user_agent
- Class methods
- new
- Private methods
-
bundler_cert_store -
cis -
connection -
downloader -
gemspec_cached_path -
remote_uri