summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/rubygems.rb14
-rwxr-xr-xlib/rubygems/core_ext/kernel_require.rb1
2 files changed, 2 insertions, 13 deletions
diff --git a/lib/rubygems.rb b/lib/rubygems.rb
index 9440ab048ab..1e79e408fba 100644
--- a/lib/rubygems.rb
+++ b/lib/rubygems.rb
@@ -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
##
diff --git a/lib/rubygems/core_ext/kernel_require.rb b/lib/rubygems/core_ext/kernel_require.rb
index 5656524f337..7407c02931c 100755
--- a/lib/rubygems/core_ext/kernel_require.rb
+++ b/lib/rubygems/core_ext/kernel_require.rb
@@ -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