[前][次][番号順一覧][スレッド一覧]

ruby-changes:67410

From: David <ko1@a...>
Date: Tue, 31 Aug 2021 19:06:53 +0900 (JST)
Subject: [ruby-changes:67410] b17cdad2f8 (master): [rubygems/rubygems] Remove redundant part of error message

https://git.ruby-lang.org/ruby.git/commit/?id=b17cdad2f8

From b17cdad2f803520ed472605cc8ef7a5350f095f7 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?David=20Rodr=C3=ADguez?= <deivid.rodriguez@r...>
Date: Sat, 31 Jul 2021 12:57:57 +0200
Subject: [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.

https://github.com/rubygems/rubygems/commit/9d56009cf7
---
 lib/bundler/resolver.rb                           | 6 +-----
 spec/bundler/commands/post_bundle_message_spec.rb | 1 -
 spec/bundler/install/gemfile/sources_spec.rb      | 1 -
 test/rubygems/test_gem.rb                         | 1 -
 4 files changed, 1 insertion(+), 8 deletions(-)

diff --git a/lib/bundler/resolver.rb b/lib/bundler/resolver.rb
index a78b2db..d19dc3e 100644
--- a/lib/bundler/resolver.rb
+++ b/lib/bundler/resolver.rb
@@ -273,11 +273,7 @@ module Bundler https://github.com/ruby/ruby/blob/trunk/lib/bundler/resolver.rb#L273
           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}."
diff --git a/spec/bundler/commands/post_bundle_message_spec.rb b/spec/bundler/commands/post_bundle_message_spec.rb
index 72f8020..3050b87 100644
--- a/spec/bundler/commands/post_bundle_message_spec.rb
+++ b/spec/bundler/commands/post_bundle_message_spec.rb
@@ -121,7 +121,6 @@ RSpec.describe "post bundle message" do https://github.com/ruby/ruby/blob/trunk/spec/bundler/commands/post_bundle_message_spec.rb#L121
         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
 
diff --git a/spec/bundler/install/gemfile/sources_spec.rb b/spec/bundler/install/gemfile/sources_spec.rb
index 8c225af..72d05aa 100644
--- a/spec/bundler/install/gemfile/sources_spec.rb
+++ b/spec/bundler/install/gemfile/sources_spec.rb
@@ -347,7 +347,6 @@ RSpec.describe "bundle install with gems on multiple sources" do https://github.com/ruby/ruby/blob/trunk/spec/bundler/install/gemfile/sources_spec.rb#L347
       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
 
diff --git a/test/rubygems/test_gem.rb b/test/rubygems/test_gem.rb
index 79ea89e..12612bd 100644
--- a/test/rubygems/test_gem.rb
+++ b/test/rubygems/test_gem.rb
@@ -1960,7 +1960,6 @@ class TestGem < Gem::TestCase https://github.com/ruby/ruby/blob/trunk/test/rubygems/test_gem.rb#L1960
 
     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
-- 
cgit v1.1


--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]