1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

[rubygems/rubygems] Don't unregister default specifications

I think this should be more efficient?

https://github.com/rubygems/rubygems/commit/a1de78104f
This commit is contained in:
David Rodríguez 2019-04-25 11:48:40 +02:00 committed by Hiroshi SHIBATA
parent 1ac6890bd0
commit 3587824d71
No known key found for this signature in database
GPG key ID: F9CF13417264FAC2
2 changed files with 2 additions and 13 deletions

View file

@ -1293,18 +1293,8 @@ An Array (#{env.inspect}) was passed in from #{caller[3]}
# Find a Gem::Specification of default gem from +path+
def find_unresolved_default_spec(path)
@path_to_default_spec_map[path]
end
##
# Remove needless Gem::Specification of default gem from
# unresolved default gem list
def remove_unresolved_default_spec(spec)
spec.files.each do |file|
@path_to_default_spec_map.delete(file)
@path_to_default_spec_map.delete(file.sub(suffix_regexp, ""))
end
default_spec = @path_to_default_spec_map[path]
return default_spec if default_spec && loaded_specs[default_spec.name] != default_spec
end
##

View file

@ -57,7 +57,6 @@ module Kernel
end
if spec = Gem.find_unresolved_default_spec(path)
Gem.remove_unresolved_default_spec(spec)
begin
Kernel.send(:gem, spec.name, "#{Gem::Requirement.default}.a")
rescue Exception