Skip to content

Commit

Permalink
Simplify printing requirements in error messages
Browse files Browse the repository at this point in the history
These are all `DepProxy`'s which already provide the same string
representation, no need to use `SharedHelpers.pretty_dependency`.
  • Loading branch information
deivid-rodriguez committed Nov 10, 2020
1 parent 3fe7288 commit a78f17c
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions bundler/lib/bundler/resolver.rb
Expand Up @@ -300,7 +300,7 @@ def verify_gemfile_dependencies_are_found!(requirements)
elsif source = @source_requirements[name]
specs = source.specs[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 = String.new("Could not find gem '#{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
Expand Down Expand Up @@ -355,7 +355,7 @@ def version_conflict_message(e)

trees.sort_by {|t| t.reverse.map(&:name) }
end,
:printable_requirement => lambda {|req| SharedHelpers.pretty_dependency(req) },
:printable_requirement => lambda {|req| req.to_s },
:additional_message_for_conflict => lambda do |o, name, conflict|
if name == "bundler"
o << %(\n Current Bundler version:\n bundler (#{Bundler::VERSION}))
Expand Down Expand Up @@ -389,7 +389,7 @@ def version_conflict_message(e)
metadata_requirement = name.end_with?("\0")

o << "Could not find gem '" unless metadata_requirement
o << SharedHelpers.pretty_dependency(conflict.requirement)
o << conflict.requirement.to_s
o << "'" unless metadata_requirement
if conflict.requirement_trees.first.size > 1
o << ", which is required by "
Expand Down

0 comments on commit a78f17c

Please sign in to comment.