Skip to content
This repository has been archived by the owner on Apr 14, 2021. It is now read-only.

Commit

Permalink
Fix multiple source warning messages from error to warn
Browse files Browse the repository at this point in the history
  • Loading branch information
jlw committed Nov 16, 2018
1 parent 9804039 commit 6732092
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 9 deletions.
17 changes: 9 additions & 8 deletions lib/bundler/cli/install.rb
Original file line number Diff line number Diff line change
Expand Up @@ -202,15 +202,16 @@ def normalize_settings
end

def warn_ambiguous_gems
# TODO: remove this when we drop Bundler 1.x support
Installer.ambiguous_gems.to_a.each do |name, installed_from_uri, *also_found_in_uris|
Bundler.ui.error "Warning: the gem '#{name}' was found in multiple sources."
Bundler.ui.error "Installed from: #{installed_from_uri}"
Bundler.ui.error "Also found in:"
also_found_in_uris.each {|uri| Bundler.ui.error " * #{uri}" }
Bundler.ui.error "You should add a source requirement to restrict this gem to your preferred source."
Bundler.ui.error "For example:"
Bundler.ui.error " gem '#{name}', :source => '#{installed_from_uri}'"
Bundler.ui.error "Then uninstall the gem '#{name}' (or delete all bundled gems) and then install again."
Bundler.ui.warn "Warning: the gem '#{name}' was found in multiple sources."
Bundler.ui.warn "Installed from: #{installed_from_uri}"
Bundler.ui.warn "Also found in:"
also_found_in_uris.each {|uri| Bundler.ui.warn " * #{uri}" }
Bundler.ui.warn "You should add a source requirement to restrict this gem to your preferred source."
Bundler.ui.warn "For example:"
Bundler.ui.warn " gem '#{name}', :source => '#{installed_from_uri}'"
Bundler.ui.warn "Then uninstall the gem '#{name}' (or delete all bundled gems) and then install again."
end
end
end
Expand Down
2 changes: 1 addition & 1 deletion lib/bundler/resolver.rb
Original file line number Diff line number Diff line change
Expand Up @@ -414,7 +414,7 @@ def validate_resolved_specs!(resolved_specs)
msg = msg.join("\n")

raise SecurityError, msg if multisource_disabled
Bundler.ui.error "Warning: #{msg}"
Bundler.ui.warn "Warning: #{msg}"
end
end
end
Expand Down

0 comments on commit 6732092

Please sign in to comment.