Preview Ruby 4.1 is a preview. It can change before the final release. Switch to Ruby 4.0 →
instance method
Gem::Source#load_compact_index_specs
load_compact_index_specs(type)
lib/rubygems/source.rb
View on GitHub ↗
# File tmp/rubies/ruby-4.1.0-preview1/lib/rubygems/source.rb, line 346
def load_compact_index_specs(type)
return unless %w[http https].include?(uri.scheme)
versions = compact_index_versions
return if versions.nil? || versions.empty?
tuples = []
versions.each_value do |rows|
gem_tuples = rows.filter_map do |row_name, version_string, suffix|
next unless Gem::Version.correct?(version_string)
version = Gem::Version.new(version_string)
next if version.prerelease? != (type == :prerelease)
suffix ||= "ruby"
content_address = suffix if Gem::ContentAddress.match?(suffix)
Gem::NameTuple.new(row_name, version, suffix, content_address: content_address)
end
gem_tuples = max_versions_by_platform(gem_tuples) if type == :latest
tuples.concat(gem_tuples)
end
tuples
end
Builds the name tuple list for type from the compact index versions file. Returns nil when the source does not provide a usable compact index, so the caller can fall back to the Marshal spec indexes.