Preview Ruby 4.1 is a preview. It can change before the final release. Switch to Ruby 4.0 →
instance method
Gem::SpecificationRecord#add_spec
add_spec(spec)
lib/rubygems/specification_record.rb
View on GitHub ↗
# File tmp/rubies/ruby-4.1.0-preview1/lib/rubygems/specification_record.rb, line 116
def add_spec(spec)
return if all.include? spec
all << spec
stubs << spec
(@stubs_by_name[spec.name] ||= []) << spec
Gem::Specification._resort!(@stubs_by_name[spec.name])
Gem::Specification._resort!(stubs)
end
Adds spec to the record, keeping the collection properly sorted.