mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
Import rubygems 1.6.2 (release candidate @ 2026fbb5)
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31081 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
08c07a215d
commit
6e5f49770c
24 changed files with 196 additions and 64 deletions
|
@ -12,10 +12,16 @@
|
|||
|
||||
module Kernel
|
||||
|
||||
##
|
||||
# The Kernel#require from before RubyGems was loaded.
|
||||
if defined?(gem_original_require) then
|
||||
# Ruby ships with a custom_require, override its require
|
||||
remove_method :require
|
||||
else
|
||||
##
|
||||
# The Kernel#require from before RubyGems was loaded.
|
||||
|
||||
alias gem_original_require require
|
||||
alias gem_original_require require
|
||||
private :gem_original_require
|
||||
end
|
||||
|
||||
##
|
||||
# When RubyGems is required, Kernel#require is replaced with our own which
|
||||
|
@ -35,15 +41,20 @@ module Kernel
|
|||
if Gem.unresolved_deps.empty? or Gem.loaded_path? path then
|
||||
gem_original_require path
|
||||
else
|
||||
specs = Gem.searcher.find_in_unresolved path
|
||||
unless specs.empty? then
|
||||
specs = [specs.last]
|
||||
else
|
||||
specs = Gem.searcher.find_in_unresolved_tree path
|
||||
end
|
||||
spec = Gem.searcher.find_active path
|
||||
|
||||
specs.each do |spec|
|
||||
Gem.activate spec.name, spec.version # FIX: this is dumb
|
||||
unless spec then
|
||||
found_specs = Gem.searcher.find_in_unresolved path
|
||||
unless found_specs.empty? then
|
||||
found_specs = [found_specs.last]
|
||||
else
|
||||
found_specs = Gem.searcher.find_in_unresolved_tree path
|
||||
end
|
||||
|
||||
found_specs.each do |found_spec|
|
||||
# FIX: this is dumb, activate a spec instead of name/version
|
||||
Gem.activate found_spec.name, found_spec.version
|
||||
end
|
||||
end
|
||||
|
||||
return gem_original_require path
|
||||
|
@ -57,7 +68,6 @@ module Kernel
|
|||
end
|
||||
|
||||
private :require
|
||||
private :gem_original_require
|
||||
|
||||
end
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue