diff options
author | Bundlerbot <bot@bundler.io> | 2019-11-06 23:07:51 +0000 |
---|---|---|
committer | David RodrÃguez <deivid.rodriguez@riseup.net> | 2019-11-07 16:41:45 +0100 |
commit | 4ae6dd3dd086485e8829709125cf8b7d934c2568 (patch) | |
tree | 0937bda19ae697da7c44be3d7a0c7e7a7c00e145 | |
parent | 4d4ea343f4de496abfeb59c8d79fe982b19483e2 (diff) | |
download | bundler-4ae6dd3dd086485e8829709125cf8b7d934c2568.tar.gz |
Merge #7427
7427: Pass `env` as a parameter to `sys_exec` r=deivid-rodriguez a=deivid-rodriguez
### What was the end-user problem that led to this PR?
The problem was that Windows has trouble with commands of the form `BUNDLE_FROZEN=true bundle install`.
### What was your diagnosis of the problem?
My diagnosis was that we should use `Open3.popen3` explicit `env` argument instead of passing a command line that has environment variables in the front.
### What is your fix for the problem, implemented in this PR?
My fix is to do just that. This is a follow up to #7011, but specifically for the `ruby` test helper. I expect this to fix some more Windows failures.
Co-authored-by: David RodrÃguez <deivid.rodriguez@riseup.net>
(cherry picked from commit 6f452d62eb76c2699988e75b7a0eb69232026259)
-rw-r--r-- | spec/support/helpers.rb | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/spec/support/helpers.rb b/spec/support/helpers.rb index 1099602fc1..8bf76bba89 100644 --- a/spec/support/helpers.rb +++ b/spec/support/helpers.rb @@ -172,10 +172,10 @@ module Spec end def ruby(ruby, options = {}) - env = (options.delete(:env) || {}).map {|k, v| "#{k}='#{v}' " }.join + env = options.delete(:env) || {} ruby = ruby.gsub(/["`\$]/) {|m| "\\#{m}" } lib_option = options[:no_lib] ? "" : " -I#{lib_dir}" - sys_exec(%(#{env}#{Gem.ruby}#{lib_option} -e "#{ruby}")) + sys_exec(%(#{Gem.ruby}#{lib_option} -e "#{ruby}"), env) end bang :ruby |