Created
February 21, 2012 00:23
-
-
Save epitron/1872524 to your computer and use it in GitHub Desktop.
cirwin's WTF command
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Pry.commands.command(/^wtf([?!]*)/, "show backtrace") do |arg| | |
raise Pry::CommandError, "No most-recent exception" unless _pry_.last_exception | |
output.puts _pry_.last_exception | |
output.puts _pry_.last_exception.backtrace.first([arg.size, 0.5].max * 10) | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment