diff options
-rw-r--r-- | lib/bundler/compact_index_client/updater.rb | 12 | ||||
-rw-r--r-- | spec/bundler/compact_index_client/updater_spec.rb | 17 |
2 files changed, 0 insertions, 29 deletions
diff --git a/lib/bundler/compact_index_client/updater.rb b/lib/bundler/compact_index_client/updater.rb index f69b81f116..8dd8de3d06 100644 --- a/lib/bundler/compact_index_client/updater.rb +++ b/lib/bundler/compact_index_client/updater.rb @@ -29,8 +29,6 @@ module Bundler headers = {} Bundler::SharedHelpers.filesystem_access(Dir.tmpdir, :write) do - validate_permissions_on_home - Dir.mktmpdir("bundler-compact-index-") do |local_temp_dir| local_temp_path = Pathname.new(local_temp_dir).join(local_path.basename) @@ -106,16 +104,6 @@ module Bundler Digest::MD5.hexdigest(IO.read(path)) end end - - private - - def validate_permissions_on_home - return if File.stat(ENV["HOME"]).writable? - raise Bundler::PermissionError, - "Bundler does not have write access to $HOME. Bundler must " \ - "have write access to $HOME to function properly. " \ - "$HOME is currently #{ENV["HOME"]}" - end end end end diff --git a/spec/bundler/compact_index_client/updater_spec.rb b/spec/bundler/compact_index_client/updater_spec.rb index 0bd913ee7f..ebec684a26 100644 --- a/spec/bundler/compact_index_client/updater_spec.rb +++ b/spec/bundler/compact_index_client/updater_spec.rb @@ -42,21 +42,4 @@ RSpec.describe Bundler::CompactIndexClient::Updater do end.to raise_error(Bundler::PermissionError) end end - - context "when bundler doesn't have permissions on $HOME" do - let(:response) { double(:response, :body => "") } - let(:local_path) { Pathname("/tmp/localpath") } - let(:remote_path) { double(:remote_path) } - let(:home_file_stat) { File::Stat.new("/") } - - it "Bundler::PermissionError is raised" do - allow(Dir).to receive(:tmpdir) { "/tmp" } - allow(File).to receive(:stat).with(anything) { home_file_stat } - allow(home_file_stat).to receive(:writable?) { false } - - expect do - updater.update(local_path, remote_path) - end.to raise_error(Bundler::PermissionError) - end - end end |