[rubygems/rubygems] Also disambiguate gems not in the first Gem.path position
https://github.com/rubygems/rubygems/commit/7e6e7ccc58
This commit is contained in:
parent
5c573b7652
commit
c2f8e91815
@ -105,6 +105,13 @@ class Gem::BasicSpecification
|
|||||||
default_gem? ? 1 : -1
|
default_gem? ? 1 : -1
|
||||||
end
|
end
|
||||||
|
|
||||||
|
##
|
||||||
|
# Gems higher up in +gem_path+ take precedence
|
||||||
|
|
||||||
|
def base_dir_priority(gem_path)
|
||||||
|
gem_path.index(base_dir) || gem_path.size
|
||||||
|
end
|
||||||
|
|
||||||
##
|
##
|
||||||
# Returns full path to the directory where gem's extensions are installed.
|
# Returns full path to the directory where gem's extensions are installed.
|
||||||
|
|
||||||
|
@ -771,6 +771,11 @@ class Gem::Specification < Gem::BasicSpecification
|
|||||||
end
|
end
|
||||||
private_class_method :clear_load_cache
|
private_class_method :clear_load_cache
|
||||||
|
|
||||||
|
def self.gem_path # :nodoc:
|
||||||
|
Gem.path
|
||||||
|
end
|
||||||
|
private_class_method :gem_path
|
||||||
|
|
||||||
def self.each_gemspec(dirs) # :nodoc:
|
def self.each_gemspec(dirs) # :nodoc:
|
||||||
dirs.each do |dir|
|
dirs.each do |dir|
|
||||||
Gem::Util.glob_files_in_dir("*.gemspec", dir).each do |path|
|
Gem::Util.glob_files_in_dir("*.gemspec", dir).each do |path|
|
||||||
@ -834,7 +839,7 @@ class Gem::Specification < Gem::BasicSpecification
|
|||||||
next platforms if platforms.nonzero?
|
next platforms if platforms.nonzero?
|
||||||
default_gem = a.default_gem_priority <=> b.default_gem_priority
|
default_gem = a.default_gem_priority <=> b.default_gem_priority
|
||||||
next default_gem if default_gem.nonzero?
|
next default_gem if default_gem.nonzero?
|
||||||
b.base_dir == Gem.path.first ? 1 : -1
|
a.base_dir_priority(gem_path) <=> b.base_dir_priority(gem_path)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -910,7 +915,7 @@ class Gem::Specification < Gem::BasicSpecification
|
|||||||
# Return the directories that Specification uses to find specs.
|
# Return the directories that Specification uses to find specs.
|
||||||
|
|
||||||
def self.dirs
|
def self.dirs
|
||||||
@@dirs ||= Gem::SpecificationRecord.dirs_from(Gem.path)
|
@@dirs ||= Gem::SpecificationRecord.dirs_from(gem_path)
|
||||||
end
|
end
|
||||||
|
|
||||||
##
|
##
|
||||||
|
Loading…
x
Reference in New Issue
Block a user