summaryrefslogtreecommitdiff
path: root/lib/rubygems/specification.rb
diff options
context:
space:
mode:
authorHiroshi SHIBATA <hsbt@ruby-lang.org>2019-06-01 12:45:11 +0300
committerHiroshi SHIBATA <hsbt@ruby-lang.org>2019-06-01 13:50:41 +0300
commit56660de3c6df7a4ff8667ef4047d30d0de169935 (patch)
treedd1e526075687b4b24e089cee50eabc21a6143cc /lib/rubygems/specification.rb
parent560cd5b1f04f30542a294b3d77527d3b12f7cc15 (diff)
Merge rubygems master from upstream.
I picked the commit from 3c469e0da538428a0ddd94f99aa73c32da22e8ba
Diffstat (limited to 'lib/rubygems/specification.rb')
-rw-r--r--lib/rubygems/specification.rb18
1 files changed, 2 insertions, 16 deletions
diff --git a/lib/rubygems/specification.rb b/lib/rubygems/specification.rb
index 942e49bf84..c1286369be 100644
--- a/lib/rubygems/specification.rb
+++ b/lib/rubygems/specification.rb
@@ -743,9 +743,6 @@ class Gem::Specification < Gem::BasicSpecification
def self._all # :nodoc:
unless defined?(@@all) && @@all
@@all = stubs.map(&:to_spec)
- if @@all.any?(&:nil?) # TODO: remove once we're happy
- raise "pid: #{$$} nil spec! included in #{stubs.inspect}"
- end
# After a reset, make sure already loaded specs
# are still marked as activated.
@@ -896,7 +893,6 @@ class Gem::Specification < Gem::BasicSpecification
# -- wilsonb
def self.all=(specs)
- raise "nil spec!" if specs.any?(&:nil?) # TODO: remove once we're happy
@@stubs_by_name = specs.group_by(&:name)
@@all = @@stubs = specs
end
@@ -1498,16 +1494,7 @@ class Gem::Specification < Gem::BasicSpecification
paths = full_require_paths
- # gem directories must come after -I and ENV['RUBYLIB']
- insert_index = Gem.load_path_insert_index
-
- if insert_index
- # gem directories must come after -I and ENV['RUBYLIB']
- $LOAD_PATH.insert(insert_index, *paths)
- else
- # we are probably testing in core, -I and RUBYLIB don't apply
- $LOAD_PATH.unshift(*paths)
- end
+ Gem.add_to_load_path(*paths)
end
##
@@ -1927,8 +1914,7 @@ class Gem::Specification < Gem::BasicSpecification
end
def gems_dir
- # TODO: this logic seems terribly broken, but tests fail if just base_dir
- @gems_dir ||= File.join(loaded_from && base_dir || Gem.dir, "gems")
+ @gems_dir ||= File.join(base_dir, "gems")
end
##