summaryrefslogtreecommitdiff
path: root/lib/rubygems/commands
diff options
context:
space:
mode:
authorbronzdoc <lsagastume1990@gmail.com>2019-07-25 23:54:06 -0600
committerHiroshi SHIBATA <hsbt@ruby-lang.org>2019-08-17 07:35:48 +0900
commit89ad5df979727ab50eee6106550bf58b1888486e (patch)
tree4b5d80d208686fc25deb39763a3d535298d9bd01 /lib/rubygems/commands
parentb8984370daaff4809b04330a6d7098f171568f79 (diff)
[rubygems/rubygems] Replace domain parameter in Gem::Command#show_lookup_failure with a parameter to suppress suggestions
https://github.com/rubygems/rubygems/commit/760b7d834f
Diffstat (limited to 'lib/rubygems/commands')
-rw-r--r--lib/rubygems/commands/install_command.rb5
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/rubygems/commands/install_command.rb b/lib/rubygems/commands/install_command.rb
index 0085d68cf3..753ff33eb5 100644
--- a/lib/rubygems/commands/install_command.rb
+++ b/lib/rubygems/commands/install_command.rb
@@ -218,6 +218,7 @@ You can use `i` command instead of `install`.
gem_version ||= options[:version]
domain = options[:domain]
domain = :local unless options[:suggest_alternate]
+ supress_suggestions = (domain == :local)
begin
install_gem gem_name, gem_version
@@ -225,11 +226,11 @@ You can use `i` command instead of `install`.
alert_error "Error installing #{gem_name}:\n\t#{e.message}"
exit_code |= 1
rescue Gem::GemNotFoundException => e
- show_lookup_failure e.name, e.version, e.errors, domain
+ show_lookup_failure e.name, e.version, e.errors, supress_suggestions
exit_code |= 2
rescue Gem::UnsatisfiableDependencyError => e
- show_lookup_failure e.name, e.version, e.errors, domain,
+ show_lookup_failure e.name, e.version, e.errors, supress_suggestions,
"'#{gem_name}' (#{gem_version})"
exit_code |= 2