summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorDavid Rodríguez <deivid.rodriguez@riseup.net>2019-11-26 22:27:17 +0100
committerDavid Rodríguez <deivid.rodriguez@riseup.net>2019-11-26 22:27:17 +0100
commitaac6e6da67395178edb34ed9fd0cd6279f8cc579 (patch)
tree799abcbb38934f05d5ad1151e6ed371266d5b55f /lib
parent3e54fbc7b1e28e25eaac465a825cdd16facfe999 (diff)
downloadbundler-aac6e6da67395178edb34ed9fd0cd6279f8cc579.tar.gz
Lazily load `open3`
Since it's a default gem now, it's better to load it as late as possible.
Diffstat (limited to 'lib')
-rw-r--r--lib/bundler/source/git/git_proxy.rb3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/bundler/source/git/git_proxy.rb b/lib/bundler/source/git/git_proxy.rb
index 2a4d7138a4..671610e7c1 100644
--- a/lib/bundler/source/git/git_proxy.rb
+++ b/lib/bundler/source/git/git_proxy.rb
@@ -1,6 +1,5 @@
# frozen_string_literal: true
-require "open3"
require "shellwords"
module Bundler
@@ -243,12 +242,14 @@ module Bundler
end
def capture_and_filter_stderr(uri, cmd)
+ require "open3"
return_value, captured_err, status = Open3.capture3(cmd)
Bundler.ui.warn URICredentialsFilter.credential_filtered_string(captured_err, uri) if uri && !captured_err.empty?
[return_value, status]
end
def capture_and_ignore_stderr(cmd)
+ require "open3"
return_value, _, status = Open3.capture3(cmd)
[return_value, status]
end