diff options
author | Bundlerbot <bot@bundler.io> | 2019-11-26 23:18:38 +0000 |
---|---|---|
committer | Bundlerbot <bot@bundler.io> | 2019-11-26 23:18:38 +0000 |
commit | 2a5378c8c50773b6f8974eb4914894c7c5bd766b (patch) | |
tree | 8ebbf21e3a2f37e10008cbc2e23e427b7411511b /spec | |
parent | 87449d535a731b818411523e34468f1f548adca9 (diff) | |
parent | aac6e6da67395178edb34ed9fd0cd6279f8cc579 (diff) | |
download | bundler-2a5378c8c50773b6f8974eb4914894c7c5bd766b.tar.gz |
Merge #7455
7455: Lazily load `open3` r=deivid-rodriguez a=deivid-rodriguez
### What was the end-user problem that led to this PR?
The problem was `open3` will be gemified in ruby 2.7, and since we use it inside `bundler`, we might activate a version causing a conflict with the user's choice.
### What was your diagnosis of the problem?
My diagnosis was that only loading it when needed should be better.
### What is your fix for the problem, implemented in this PR?
My fix is to lazily load it.
I expect this PR to fix [some of the errors](https://travis-ci.org/bundler/bundler/jobs/615940817) currently happening in our CI against ruby-head.
Co-authored-by: David RodrÃguez <deivid.rodriguez@riseup.net>
Diffstat (limited to 'spec')
-rw-r--r-- | spec/support/helpers.rb | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/spec/support/helpers.rb b/spec/support/helpers.rb index d085b769d7..95c2d60d56 100644 --- a/spec/support/helpers.rb +++ b/spec/support/helpers.rb @@ -1,7 +1,5 @@ # frozen_string_literal: true -require "open3" - require_relative "command_execution" require_relative "the_bundle" @@ -211,6 +209,7 @@ module Spec env = env.map {|k, v| [k.to_s, v.to_s] }.to_h # convert env keys and values to string + require "open3" Open3.popen3(env, cmd.to_s) do |stdin, stdout, stderr, wait_thr| yield stdin, stdout, wait_thr if block_given? stdin.close |