mirror of
https://github.com/ruby/ruby.git
synced 2025-09-21 03:24:00 +02:00
Merge RubyGems-3.3.18 and Bundler-2.3.18
This commit is contained in:
parent
7ef68dd74a
commit
0918783347
69 changed files with 586 additions and 167 deletions
|
@ -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.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue