Skip to content

Instantly share code, notes, and snippets.

@epitron
Created February 21, 2012 00:23
Show Gist options
  • Save epitron/1872524 to your computer and use it in GitHub Desktop.
Save epitron/1872524 to your computer and use it in GitHub Desktop.
cirwin's WTF command
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