summaryrefslogtreecommitdiff
path: root/lib/bundler
diff options
context:
space:
mode:
authorDavid Rodríguez <deivid.rodriguez@riseup.net>2021-12-14 14:49:43 +0100
committergit <svn-admin@ruby-lang.org>2021-12-17 16:35:17 +0900
commitaf4b4fd19b7972adc165e70e9d41ad7e14c9a235 (patch)
tree9b2b458ae30d7ef637beb8ebf81afc3175326a97 /lib/bundler
parentce6fc20f973e307071533bfd9699da88986c67a3 (diff)
[rubygems/rubygems] Improve resolver error messages
Use a more standard naming for gems. https://github.com/rubygems/rubygems/commit/75121e83f1
Diffstat (limited to 'lib/bundler')
-rw-r--r--lib/bundler/resolver.rb14
1 files changed, 1 insertions, 13 deletions
diff --git a/lib/bundler/resolver.rb b/lib/bundler/resolver.rb
index 5eb17a3921..8830621e0e 100644
--- a/lib/bundler/resolver.rb
+++ b/lib/bundler/resolver.rb
@@ -264,30 +264,18 @@ module Bundler
else
source = source_for(name)
specs = source.specs.search(name)
- versions_with_platforms = specs.map {|s| [s.version, s.platform] }
cache_message = begin
" or in gems cached in #{Bundler.settings.app_cache_path}" if Bundler.app_cache.exist?
rescue GemfileNotFound
nil
end
message = String.new("Could not find gem '#{SharedHelpers.pretty_dependency(requirement)}' in #{source}#{cache_message}.\n")
- message << "The source contains the following versions of '#{name}': #{formatted_versions_with_platforms(versions_with_platforms)}" if versions_with_platforms.any?
+ message << "The source contains the following gems matching '#{name}': #{specs.map(&:full_name).join(", ")}" if specs.any?
end
raise GemNotFound, message
end
end
- def formatted_versions_with_platforms(versions_with_platforms)
- version_platform_strs = versions_with_platforms.map do |vwp|
- version = vwp.first
- platform = vwp.last
- version_platform_str = String.new(version.to_s)
- version_platform_str << " #{platform}" unless platform.nil? || platform == Gem::Platform::RUBY
- version_platform_str
- end
- version_platform_strs.join(", ")
- end
-
def version_conflict_message(e)
# only show essential conflicts, if possible
conflicts = e.conflicts.dup