summaryrefslogtreecommitdiff
path: root/lib/bundler.rb
diff options
context:
space:
mode:
authorHiroshi SHIBATA <hsbt@ruby-lang.org>2021-11-11 10:40:30 +0900
committernagachika <nagachika@ruby-lang.org>2021-11-22 10:51:35 +0900
commit31a71048521224774bdb8b5982ab73eb35dad66d (patch)
tree8174af2f04f4b31abf0f4ab08d779055f513cdaa /lib/bundler.rb
parent6d540c1b9844a5832846618b53ce35d12d64deac (diff)
Merge RubyGems 3.2.27 and Bundler 2.2.27
Diffstat (limited to 'lib/bundler.rb')
-rw-r--r--lib/bundler.rb28
1 files changed, 11 insertions, 17 deletions
diff --git a/lib/bundler.rb b/lib/bundler.rb
index 439c8cbb86..a7676cd497 100644
--- a/lib/bundler.rb
+++ b/lib/bundler.rb
@@ -636,6 +636,12 @@ EOF
@rubygems = nil
end
+ def configure_gem_home_and_path(path = bundle_path)
+ configure_gem_path
+ configure_gem_home(path)
+ Bundler.rubygems.clear_paths
+ end
+
private
def eval_yaml_gemspec(path, contents)
@@ -656,29 +662,17 @@ EOF
raise GemspecError, Dsl::DSLError.new(msg, path, e.backtrace, contents)
end
- def configure_gem_home_and_path
- configure_gem_path
- configure_gem_home
- bundle_path
- end
-
- def configure_gem_path(env = ENV)
- blank_home = env["GEM_HOME"].nil? || env["GEM_HOME"].empty?
- if !use_system_gems?
+ def configure_gem_path
+ unless use_system_gems?
# this needs to be empty string to cause
# PathSupport.split_gem_path to only load up the
# Bundler --path setting as the GEM_PATH.
- env["GEM_PATH"] = ""
- elsif blank_home
- possibles = [Bundler.rubygems.gem_dir, Bundler.rubygems.gem_path]
- paths = possibles.flatten.compact.uniq.reject(&:empty?)
- env["GEM_PATH"] = paths.join(File::PATH_SEPARATOR)
+ Bundler::SharedHelpers.set_env "GEM_PATH", ""
end
end
- def configure_gem_home
- Bundler::SharedHelpers.set_env "GEM_HOME", File.expand_path(bundle_path, root)
- Bundler.rubygems.clear_paths
+ def configure_gem_home(path)
+ Bundler::SharedHelpers.set_env "GEM_HOME", path.to_s
end
def tmp_home_path