From 245b4f0ed1f346312781d7e9d2a87d0ecc5c5202 Mon Sep 17 00:00:00 2001 From: Bundlerbot Date: Wed, 27 Nov 2019 09:34:36 +0000 Subject: [PATCH] Merge #7456 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 7456: Lazily load CGI r=deivid-rodriguez a=deivid-rodriguez Thanks so much for the contribution! To make reviewing this PR a bit easier, please fill out answers to the following questions. ### What was the end-user problem that led to this PR? The problem was that our ruby-head build is failing in CI. ### What was your diagnosis of the problem? My diagnosis was that since `cgi` is now a default gem on ruby 2.7, we're getting someunintended activations of the new default gem inside our specs. ### What is your fix for the problem, implemented in this PR? My fix is to lazily load CGI. Co-authored-by: David Rodríguez (cherry picked from commit c3eae8ea436af06ab2c3f4bdd25bd9dd6e7c9eef) --- lib/bundler/friendly_errors.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/bundler/friendly_errors.rb b/lib/bundler/friendly_errors.rb index 273573e8206..080697b02c0 100644 --- a/lib/bundler/friendly_errors.rb +++ b/lib/bundler/friendly_errors.rb @@ -1,6 +1,5 @@ # frozen_string_literal: true -require "cgi" require_relative "vendored_thor" module Bundler @@ -114,6 +113,7 @@ def request_issue_report_for(e) def issues_url(exception) message = exception.message.lines.first.tr(":", " ").chomp message = message.split("-").first if exception.is_a?(Errno) + require "cgi" "https://github.com/bundler/bundler/search?q=" \ "#{CGI.escape(message)}&type=Issues" end