diff options
author | David RodrÃguez <deivid.rodriguez@riseup.net> | 2021-07-25 16:11:18 +0200 |
---|---|---|
committer | Hiroshi SHIBATA <hsbt@ruby-lang.org> | 2021-07-27 09:25:56 +0900 |
commit | 9cddc0ec94806b9f6850e0206f5cefd5ca5e5362 (patch) | |
tree | 63861f7fcb1951764767d108056a7aec5eb69d4e /lib | |
parent | 9ac89fe35e0ddbf28be436c275e1de5287e35c23 (diff) |
[rubygems/rubygems] Lazily load `shellwords` library
https://github.com/rubygems/rubygems/commit/e5532ef886
Diffstat (limited to 'lib')
-rw-r--r-- | lib/rubygems/ext/builder.rb | 1 | ||||
-rw-r--r-- | lib/rubygems/ext/ext_conf_builder.rb | 3 | ||||
-rw-r--r-- | lib/rubygems/ext/rake_builder.rb | 3 |
3 files changed, 3 insertions, 4 deletions
diff --git a/lib/rubygems/ext/builder.rb b/lib/rubygems/ext/builder.rb index 14d5dde413..7934309901 100644 --- a/lib/rubygems/ext/builder.rb +++ b/lib/rubygems/ext/builder.rb @@ -57,6 +57,7 @@ class Gem::Ext::Builder p(command) end results << "current directory: #{dir}" + require "shellwords" results << command.shelljoin require "open3" diff --git a/lib/rubygems/ext/ext_conf_builder.rb b/lib/rubygems/ext/ext_conf_builder.rb index 1f73796351..3ca3463615 100644 --- a/lib/rubygems/ext/ext_conf_builder.rb +++ b/lib/rubygems/ext/ext_conf_builder.rb @@ -5,8 +5,6 @@ # See LICENSE.txt for permissions. #++ -require 'shellwords' - class Gem::Ext::ExtConfBuilder < Gem::Ext::Builder def self.build(extension, dest_path, results, args=[], lib_dir=nil, extension_dir=Dir.pwd) require 'fileutils' @@ -40,6 +38,7 @@ class Gem::Ext::ExtConfBuilder < Gem::Ext::Builder begin # workaround for https://github.com/oracle/truffleruby/issues/2115 siteconf_path = RUBY_ENGINE == "truffleruby" ? siteconf.path.dup : siteconf.path + require "shellwords" cmd = Gem.ruby.shellsplit << "-I" << File.expand_path("../../..", __FILE__) << "-r" << get_relative_path(siteconf_path, extension_dir) << File.basename(extension) cmd.push(*args) diff --git a/lib/rubygems/ext/rake_builder.rb b/lib/rubygems/ext/rake_builder.rb index 64a6c0eb80..fed98e741c 100644 --- a/lib/rubygems/ext/rake_builder.rb +++ b/lib/rubygems/ext/rake_builder.rb @@ -5,8 +5,6 @@ # See LICENSE.txt for permissions. #++ -require "shellwords" - class Gem::Ext::RakeBuilder < Gem::Ext::Builder def self.build(extension, dest_path, results, args=[], lib_dir=nil, extension_dir=Dir.pwd) if File.basename(extension) =~ /mkrf_conf/i @@ -16,6 +14,7 @@ class Gem::Ext::RakeBuilder < Gem::Ext::Builder rake = ENV['rake'] if rake + require "shellwords" rake = rake.shellsplit else begin |