summaryrefslogtreecommitdiff
path: root/lib/bundler
diff options
context:
space:
mode:
authorSamuel E. Giddins <segiddins@segiddins.me>2015-07-20 23:38:59 -0700
committerSamuel E. Giddins <segiddins@segiddins.me>2015-07-21 00:14:54 -0700
commit0163e2170ba6f3161412418deb1f184a99171900 (patch)
tree77f0a926e158467de596362d911b9fe3faedf5b5 /lib/bundler
parent3d4761087371ade281fde53e73d37d5dcca88637 (diff)
downloadbundler-0163e2170ba6f3161412418deb1f184a99171900.tar.gz
[Resolver] Improve formatting of error messages
Diffstat (limited to 'lib/bundler')
-rw-r--r--lib/bundler/resolver.rb9
1 files changed, 6 insertions, 3 deletions
diff --git a/lib/bundler/resolver.rb b/lib/bundler/resolver.rb
index 14a33f5e46..f21c9cf305 100644
--- a/lib/bundler/resolver.rb
+++ b/lib/bundler/resolver.rb
@@ -12,11 +12,13 @@ module Bundler
class Molinillo::VersionConflict
def clean_req(req)
+ req = req.to_s.chomp(" ruby")
if req.to_s.include?(">= 0")
- req.to_s.gsub(/ \(.*?\)$/, "")
+ req = req.to_s.gsub(/ \(.*?\)$/, "")
else
- req.to_s.gsub(/\, (runtime|development)\)$/, ")")
+ req = req.to_s.gsub(/\, (runtime|development)\)$/, ")")
end
+ req.gsub(/\).*/, ")")
end
def message
@@ -33,7 +35,7 @@ module Bundler
depth = 2
tree.each do |req|
t << " " * depth << %(#{clean_req req})
- t << %( depends on) unless tree[-1] == req
+ t << %( depends on) unless tree.last == req
t << %(\n)
depth += 1
end
@@ -55,6 +57,7 @@ module Bundler
o << %(Running `bundle update` will rebuild your snapshot from scratch, using only\n)
o << %(the gems in your Gemfile, which may resolve the conflict.\n)
elsif !conflict.existing
+ o << "\n"
if conflict.requirement_trees.first.size > 1
o << "Could not find gem '#{clean_req(conflict.requirement)}', which is required by "
o << "gem '#{clean_req(conflict.requirement_trees.first[-2])}', in any of the sources."