Skip to content

Instantly share code, notes, and snippets.

@rosedomini
Created July 4, 2014 14:07
Show Gist options
  • Save rosedomini/2b5b13869af359e71fc6 to your computer and use it in GitHub Desktop.
Save rosedomini/2b5b13869af359e71fc6 to your computer and use it in GitHub Desktop.
Displays little but pertinent information about an error
module Error
ProjectPath = "/Users/../analyse"
def self.light
message = "in #{($@.reverse[0..-1]).join(":\nin ")}
in #{$@[0]}:\n\t#{$!} (#{$!.class})"
message.gsub! ProjectPath, "$"
message.gsub! /\n\t+/, "\n"
puts
puts message.split("\n")[-1]
puts "\t" << message.split("\n")[-3..-2].join("\n\t")
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment