Merge RubyGems-3.3.18 and Bundler-2.3.18

This commit is contained in:
Hiroshi SHIBATA 2022-08-22 11:49:20 +09:00 committed by nagachika
parent 7ef68dd74a
commit 0918783347
69 changed files with 586 additions and 167 deletions

View file

@ -883,6 +883,30 @@ class Gem::Specification < Gem::BasicSpecification
end
end
##
# Adds +spec+ to the known specifications, keeping the collection
# properly sorted.
def self.add_spec(spec)
return if _all.include? spec
_all << spec
stubs << spec
(@@stubs_by_name[spec.name] ||= []) << spec
_resort!(@@stubs_by_name[spec.name])
_resort!(stubs)
end
##
# Removes +spec+ from the known specs.
def self.remove_spec(spec)
_all.delete spec.to_spec
stubs.delete spec
(@@stubs_by_name[spec.name] || []).delete spec
end
##
# Returns all specifications. This method is discouraged from use.
# You probably want to use one of the Enumerable methods instead.