Preview Ruby 4.1 is a preview. It can change before the final release. Switch to Ruby 4.0 →
class method
Gem::SpecFetcher.new
new(sources = nil)
lib/rubygems/spec_fetcher.rb
View on GitHub ↗
# File tmp/rubies/ruby-4.1.0-preview1/lib/rubygems/spec_fetcher.rb, line 57
def initialize(sources = nil)
@sources = sources || Gem.sources
@update_cache =
begin
File.stat(Gem.user_home).uid == Process.uid
rescue Errno::EACCES, Errno::ENOENT
false
end
@specs = {}
@latest_specs = {}
@prerelease_specs = {}
@caches = {
latest: @latest_specs,
prerelease: @prerelease_specs,
released: @specs,
}
@fetcher = Gem::RemoteFetcher.fetcher
end
Creates a new SpecFetcher. Ordinarily you want to use the default fetcher from Gem::SpecFetcher::fetcher which uses the Gem.sources.
If you need to retrieve specifications from a different source, you can send it as an argument.
See also
.fetcher
#available_specs
#decode_content_addressable_tuples
also in
4.0 · 3.4 · 3.3 · 3.2 · 3.1 · 3.0