Commit 56d633b9 authored by Samuel E. Giddins's avatar Samuel E. Giddins

[ErrorReporter] Extract pathless_exception_message

parent 6e5ea313
...@@ -7,8 +7,11 @@ module Pod ...@@ -7,8 +7,11 @@ module Pod
module UserInterface module UserInterface
module ErrorReport module ErrorReport
class << self class << self
def pathless_exception_message(message)
message.gsub(/- \(.*\):/, '-')
end
def report(exception) def report(exception)
pathless_exception_message = exception.message.gsub(/- \(.*\):/, '- ():')
return <<-EOS return <<-EOS
#{'――― MARKDOWN TEMPLATE ―――――――――――――――――――――――――――――――――――――――――――――――――――――――――――'.reversed} #{'――― MARKDOWN TEMPLATE ―――――――――――――――――――――――――――――――――――――――――――――――――――――――――――'.reversed}
...@@ -46,7 +49,7 @@ Repositories : #{repo_information.join("\n ")} ...@@ -46,7 +49,7 @@ Repositories : #{repo_information.join("\n ")}
#{'[!] Oh no, an error occurred.'.red} #{'[!] Oh no, an error occurred.'.red}
#{error_from_podfile(exception)} #{error_from_podfile(exception)}
#{'Search for existing github issues similar to yours:'.yellow} #{'Search for existing github issues similar to yours:'.yellow}
#{"https://github.com/CocoaPods/CocoaPods/search?q=#{CGI.escape(pathless_exception_message)}&type=Issues"} #{"https://github.com/CocoaPods/CocoaPods/search?q=#{CGI.escape(pathless_exception_message(exception.message))}&type=Issues"}
#{'If none exists, create a ticket, with the template displayed above, on:'.yellow} #{'If none exists, create a ticket, with the template displayed above, on:'.yellow}
https://github.com/CocoaPods/CocoaPods/issues/new https://github.com/CocoaPods/CocoaPods/issues/new
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment