summaryrefslogtreecommitdiff
path: root/lib/bundler/rubygems_gem_installer.rb
diff options
context:
space:
mode:
authorDavid Rodríguez <deivid.rodriguez@riseup.net>2022-07-15 21:34:51 +0200
committergit <svn-admin@ruby-lang.org>2022-07-17 17:47:22 +0900
commit3cfc3fcf96a414fc1a966eacc57a282aa2580547 (patch)
treea568d05081dc42ae5003d110fecba1860b4d924c /lib/bundler/rubygems_gem_installer.rb
parent14f52cfce53711fda7f144b70c2d3d8b04b709e2 (diff)
[rubygems/rubygems] Unify some common code
https://github.com/rubygems/rubygems/commit/972e8ff965
Diffstat (limited to 'lib/bundler/rubygems_gem_installer.rb')
-rw-r--r--lib/bundler/rubygems_gem_installer.rb8
1 files changed, 6 insertions, 2 deletions
diff --git a/lib/bundler/rubygems_gem_installer.rb b/lib/bundler/rubygems_gem_installer.rb
index d0a88ae7c7..098ef0a356 100644
--- a/lib/bundler/rubygems_gem_installer.rb
+++ b/lib/bundler/rubygems_gem_installer.rb
@@ -67,7 +67,7 @@ module Bundler
def build_extensions
extension_cache_path = options[:bundler_extension_cache_path]
unless extension_cache_path && extension_dir = spec.extension_dir
- require "shellwords" unless Bundler.rubygems.provides?(">= 3.2.25")
+ prepare_extension_build
return super
end
@@ -79,7 +79,7 @@ module Bundler
FileUtils.cp_r extension_cache_path, spec.extension_dir
end
else
- require "shellwords" # compensate missing require in rubygems before version 3.2.25
+ prepare_extension_build
super
SharedHelpers.filesystem_access(extension_cache_path.parent, &:mkpath)
SharedHelpers.filesystem_access(extension_cache_path) do
@@ -98,6 +98,10 @@ module Bundler
private
+ def prepare_extension_build
+ require "shellwords" unless Bundler.rubygems.provides?(">= 3.2.25")
+ end
+
def strict_rm_rf(dir)
Bundler.rm_rf dir
rescue Errno::ENOTEMPTY => e