summaryrefslogtreecommitdiff
path: root/lib/rubygems.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.rb
parent560cd5b1f04f30542a294b3d77527d3b12f7cc15 (diff)
Merge rubygems master from upstream.
I picked the commit from 3c469e0da538428a0ddd94f99aa73c32da22e8ba
Diffstat (limited to 'lib/rubygems.rb')
-rw-r--r--lib/rubygems.rb24
1 files changed, 23 insertions, 1 deletions
diff --git a/lib/rubygems.rb b/lib/rubygems.rb
index 193e8d3539..c013e4b8ed 100644
--- a/lib/rubygems.rb
+++ b/lib/rubygems.rb
@@ -670,6 +670,21 @@ An Array (#{env.inspect}) was passed in from #{caller[3]}
index
end
+ ##
+ # Add a list of paths to the $LOAD_PATH at the proper place.
+
+ def self.add_to_load_path(*paths)
+ insert_index = 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
+ end
+
@yaml_loaded = false
##
@@ -1084,6 +1099,13 @@ An Array (#{env.inspect}) was passed in from #{caller[3]}
end
##
+ # Is this a java platform?
+
+ def self.java_platform?
+ RUBY_PLATFORM == "java"
+ end
+
+ ##
# Load +plugins+ as Ruby files
def self.load_plugin_files(plugins) # :nodoc:
@@ -1243,7 +1265,7 @@ An Array (#{env.inspect}) was passed in from #{caller[3]}
#
def register_default_spec(spec)
- new_format = Gem.default_gems_use_full_paths? || spec.require_paths.any? {|path| spec.files.any? {|f| f.start_with? path } }
+ new_format = spec.require_paths.any? {|path| spec.files.any? {|f| f.start_with? path } }
if new_format
prefix_group = spec.require_paths.map {|f| f + "/"}.join("|")