ruby-modules: parse build_flags correctly:

In building a gem whose native extension is a Rakefile, the previous
version of this code will call essentially `rake ""`, when it means to
call `rake`.

This change converts `""` into `[]` rather than `[""]`.
This commit is contained in:
Burke Libbey 2019-12-16 17:50:56 -05:00 committed by Alyssa Ross
parent db59e94059
commit 62e680cdcf

View File

@ -5,6 +5,7 @@ require 'rubygems/command'
require 'fileutils' require 'fileutils'
require 'pathname' require 'pathname'
require 'tmpdir' require 'tmpdir'
require 'shellwords'
if defined?(Encoding.default_internal) if defined?(Encoding.default_internal)
Encoding.default_internal = Encoding::UTF_8 Encoding.default_internal = Encoding::UTF_8
@ -31,7 +32,7 @@ bin_dir = File.join(ENV["out"], "bin")
type = ARGV[0] type = ARGV[0]
name = ARGV[1] name = ARGV[1]
version = ARGV[2] version = ARGV[2]
build_flags = ARGV[3] build_flags = Shellwords.split(ARGV[3])
if type == "git" if type == "git"
uri = ARGV[4] uri = ARGV[4]
REPO = ARGV[5] REPO = ARGV[5]
@ -117,7 +118,7 @@ else
source = Bundler::Source::Path.new(options) source = Bundler::Source::Path.new(options)
end end
spec = source.specs.search_all(name).first spec = source.specs.search_all(name).first
Bundler.rubygems.with_build_args [build_flags] do Bundler.rubygems.with_build_args build_flags do
source.install(spec) source.install(spec)
end end