Skip to content

Commit

Permalink
[rubygems/rubygems] Remove redundant part of error message
Browse files Browse the repository at this point in the history
It doesn't really add much, in my opinion. We want to be helpful, but
also concise when possible.

rubygems/rubygems@9d56009cf7
  • Loading branch information
deivid-rodriguez authored and hsbt committed Aug 31, 2021
1 parent f1c0729 commit b17cdad
Show file tree
Hide file tree
Showing 4 changed files with 1 addition and 8 deletions.
6 changes: 1 addition & 5 deletions lib/bundler/resolver.rb
Expand Up @@ -273,11 +273,7 @@ def verify_gemfile_dependencies_are_found!(requirements)
specs = source.specs.search(name)
versions_with_platforms = specs.map {|s| [s.version, s.platform] }
message = String.new("Could not find gem '#{SharedHelpers.pretty_dependency(requirement)}' in #{source}#{cache_message}.\n")
message << if versions_with_platforms.any?
"The source contains the following versions of '#{name}': #{formatted_versions_with_platforms(versions_with_platforms)}"
else
"The source does not contain any versions of '#{name}'"
end
message << "The source contains the following versions of '#{name}': #{formatted_versions_with_platforms(versions_with_platforms)}" if versions_with_platforms.any?
else
message = "Could not find gem '#{SharedHelpers.pretty_dependency(requirement)}' in any of the gem sources " \
"listed in your Gemfile#{cache_message}."
Expand Down
1 change: 0 additions & 1 deletion spec/bundler/commands/post_bundle_message_spec.rb
Expand Up @@ -121,7 +121,6 @@
G
expect(err).to include <<-EOS.strip
Could not find gem 'not-a-gem' in rubygems repository #{file_uri_for(gem_repo1)}/ or installed locally.
The source does not contain any versions of 'not-a-gem'
EOS
end

Expand Down
1 change: 0 additions & 1 deletion spec/bundler/install/gemfile/sources_spec.rb
Expand Up @@ -347,7 +347,6 @@
it "fails" do
bundle :install, :artifice => "compact_index", :raise_on_error => false
expect(err).to include("Could not find gem 'private_gem_1' in rubygems repository https://gem.repo2/ or installed locally.")
expect(err).to include("The source does not contain any versions of 'private_gem_1'")
end
end

Expand Down
1 change: 0 additions & 1 deletion test/rubygems/test_gem.rb
Expand Up @@ -1960,7 +1960,6 @@ def test_use_gemdeps_missing_gem

expected = <<-EXPECTED
Could not find gem 'a' in locally installed gems.
The source does not contain any versions of 'a'
You may need to `gem install -g` to install missing gems
EXPECTED
Expand Down

0 comments on commit b17cdad

Please sign in to comment.