mirror of
				https://github.com/ruby/ruby.git
				synced 2022-11-09 12:17:21 -05:00 
			
		
		
		
	[rubygems/rubygems] Remove redundant part of error message
It doesn't really add much, in my opinion. We want to be helpful, but
also concise when possible.
9d56009cf7
			
			
This commit is contained in:
		
							parent
							
								
									f1c0729128
								
							
						
					
					
						commit
						b17cdad2f8
					
				
				
				Notes:
				
					git
				
				2021-08-31 19:07:21 +09:00 
				
			
			
			
		
		
					 4 changed files with 1 additions and 8 deletions
				
			
		| 
						 | 
				
			
			@ -273,11 +273,7 @@ module Bundler
 | 
			
		|||
          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}."
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -121,7 +121,6 @@ RSpec.describe "post bundle message" do
 | 
			
		|||
        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
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -347,7 +347,6 @@ RSpec.describe "bundle install with gems on multiple sources" do
 | 
			
		|||
      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
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -1960,7 +1960,6 @@ class TestGem < Gem::TestCase
 | 
			
		|||
 | 
			
		||||
    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
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue