class Bundler::PubGrub::FailureWriter

def write

def write
  return @root.to_s unless @root.conflict?
  visit(@root)
  padding = @line_numbers.empty? ? 0 : "(#{@line_numbers.values.last}) ".length
  @lines.map do |message, number|
    next "" if message.empty?
    lead = number ? "(#{number}) " : ""
    lead = lead.ljust(padding)
    message = message.gsub("\n", "\n" + " " * (padding + 2))
    "#{lead}#{message}"
  end.join("\n")
end