mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
[bundler/bundler] No need to activate the fileutils
default gem
The version we're vendoring actually relaxed this restriction back to 2.3.0+, so we can always use the vendored version. https://github.com/bundler/bundler/commit/d366cbfe5d
This commit is contained in:
parent
4756c5f7e7
commit
683f9e1dbf
4 changed files with 4 additions and 17 deletions
|
@ -1,9 +1,4 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
module Bundler; end
|
||||
if RUBY_VERSION >= "2.4"
|
||||
require_relative "vendor/fileutils/lib/fileutils"
|
||||
else
|
||||
# the version we vendor is 2.4+
|
||||
require "fileutils"
|
||||
end
|
||||
require_relative "vendor/fileutils/lib/fileutils"
|
||||
|
|
|
@ -176,7 +176,7 @@ RSpec.describe Bundler do
|
|||
let(:bundler_ui) { Bundler.ui }
|
||||
it "should raise a friendly error" do
|
||||
allow(File).to receive(:exist?).and_return(true)
|
||||
allow(bundler_fileutils).to receive(:remove_entry_secure).and_raise(ArgumentError)
|
||||
allow(::Bundler::FileUtils).to receive(:remove_entry_secure).and_raise(ArgumentError)
|
||||
allow(File).to receive(:world_writable?).and_return(true)
|
||||
message = <<EOF
|
||||
It is a security vulnerability to allow your home directory to be world-writable, and bundler can not continue.
|
||||
|
|
|
@ -120,7 +120,7 @@ that would suck --ehhh=oh geez it looks like i might have broken bundler somehow
|
|||
|
||||
context "when it's not possible to write to the file" do
|
||||
it "raises an PermissionError with explanation" do
|
||||
expect(bundler_fileutils).to receive(:mkdir_p).with(settings.send(:local_config_file).dirname).
|
||||
expect(::Bundler::FileUtils).to receive(:mkdir_p).with(settings.send(:local_config_file).dirname).
|
||||
and_raise(Errno::EACCES)
|
||||
expect { settings.set_local :frozen, "1" }.
|
||||
to raise_error(Bundler::PermissionError, /config/)
|
||||
|
@ -161,7 +161,7 @@ that would suck --ehhh=oh geez it looks like i might have broken bundler somehow
|
|||
describe "#set_global" do
|
||||
context "when it's not possible to write to the file" do
|
||||
it "raises an PermissionError with explanation" do
|
||||
expect(bundler_fileutils).to receive(:mkdir_p).with(settings.send(:global_config_file).dirname).
|
||||
expect(::Bundler::FileUtils).to receive(:mkdir_p).with(settings.send(:global_config_file).dirname).
|
||||
and_raise(Errno::EACCES)
|
||||
expect { settings.set_global(:frozen, "1") }.
|
||||
to raise_error(Bundler::PermissionError, %r{\.bundle/config})
|
||||
|
|
|
@ -593,13 +593,5 @@ module Spec
|
|||
end
|
||||
port
|
||||
end
|
||||
|
||||
def bundler_fileutils
|
||||
if RUBY_VERSION >= "2.4"
|
||||
::Bundler::FileUtils
|
||||
else
|
||||
::FileUtils
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue