lib/bundler.rb in bundler-2.2.22 vs lib/bundler.rb in bundler-2.2.23

- old
+ new

@@ -234,12 +234,13 @@ elsif !File.writable?(home) && (!File.directory?(bundle_home) || !File.writable?(bundle_home)) "`#{home}` is not writable." end if warning - user_home = tmp_home_path(warning) - Bundler.ui.warn "#{warning}\nBundler will use `#{user_home}' as your home directory temporarily.\n" + Bundler.ui.warn "#{warning}\n" + user_home = tmp_home_path + Bundler.ui.warn "Bundler will use `#{user_home}' as your home directory temporarily.\n" user_home else Pathname.new(home) end end @@ -682,18 +683,16 @@ def configure_gem_home Bundler::SharedHelpers.set_env "GEM_HOME", File.expand_path(bundle_path, root) Bundler.rubygems.clear_paths end - def tmp_home_path(warning) + def tmp_home_path Kernel.send(:require, "tmpdir") SharedHelpers.filesystem_access(Dir.tmpdir) do path = Bundler.tmp at_exit { Bundler.rm_rf(path) } path end - rescue RuntimeError => e - raise e.exception("#{warning}\nBundler also failed to create a temporary home directory':\n#{e}") end # @param env [Hash] def with_env(env) backup = ENV.to_hash