From 97ddcb420e95e9babd820517c10ed72b4282e8fe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20Rodr=C3=ADguez?= Date: Fri, 16 Aug 2019 17:45:00 +0200 Subject: [PATCH] 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. --- lib/bundler/vendored_fileutils.rb | 7 +------ spec/bundler/bundler_spec.rb | 2 +- spec/bundler/settings_spec.rb | 4 ++-- spec/support/helpers.rb | 8 -------- 4 files changed, 4 insertions(+), 17 deletions(-) diff --git a/lib/bundler/vendored_fileutils.rb b/lib/bundler/vendored_fileutils.rb index 4b71759224e..1be1138ce25 100644 --- a/lib/bundler/vendored_fileutils.rb +++ b/lib/bundler/vendored_fileutils.rb @@ -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" diff --git a/spec/bundler/bundler_spec.rb b/spec/bundler/bundler_spec.rb index 8a4ce729edd..3cae67c52a9 100644 --- a/spec/bundler/bundler_spec.rb +++ b/spec/bundler/bundler_spec.rb @@ -176,7 +176,7 @@ 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 = <= "2.4" - ::Bundler::FileUtils - else - ::FileUtils - end - end end end