summaryrefslogtreecommitdiff
path: root/lib/rubygems/ext/builder.rb
diff options
context:
space:
mode:
authorSamuel Williams <[email protected]>2023-06-09 22:10:56 +0900
committergit <[email protected]>2023-06-13 09:32:47 +0000
commit27b07776c99dfb4a8a4e6885462786c03e9b0660 (patch)
treeac66b3dea3d0e5282d80d59b94db37fb0a878a04 /lib/rubygems/ext/builder.rb
parentc74f42a4fbbf1b0d9267be8c2a23e4b828447172 (diff)
[rubygems/rubygems] Autoload shellwords when it's needed.
https://github.com/rubygems/rubygems/commit/e916ccb2d9
Diffstat (limited to 'lib/rubygems/ext/builder.rb')
-rw-r--r--lib/rubygems/ext/builder.rb7
1 files changed, 3 insertions, 4 deletions
diff --git a/lib/rubygems/ext/builder.rb b/lib/rubygems/ext/builder.rb
index c39afc9c9d..242dd0125a 100644
--- a/lib/rubygems/ext/builder.rb
+++ b/lib/rubygems/ext/builder.rb
@@ -7,6 +7,7 @@
#++
require_relative "../user_interaction"
+require_relative "../shellwords"
class Gem::Ext::Builder
include Gem::UserInteraction
@@ -55,9 +56,8 @@ class Gem::Ext::Builder
end
def self.ruby
- require "shellwords"
# Gem.ruby is quoted if it contains whitespace
- cmd = Gem.ruby.shellsplit
+ cmd = Shellwords.split(Gem.ruby)
# This load_path is only needed when running rubygems test without a proper installation.
# Prepending it in a normal installation will cause problem with order of $LOAD_PATH.
@@ -82,8 +82,7 @@ class Gem::Ext::Builder
p(command)
end
results << "current directory: #{dir}"
- require "shellwords"
- results << command.shelljoin
+ results << Shellwords.join(command)
require "open3"
# Set $SOURCE_DATE_EPOCH for the subprocess.