Skip to content

Instantly share code, notes, and snippets.

@forkata
Created March 14, 2014 17:52
Show Gist options
  • Save forkata/9553057 to your computer and use it in GitHub Desktop.
Save forkata/9553057 to your computer and use it in GitHub Desktop.
# stolen from http://blog.charlescy.com/blog/2013/08/26/pry-command-cheatsheet/
# who took it from Conrad Irwin's railsconf 2013 talk http://youtu.be/jDXsEzOHb2M
ls <Object> -- Show all of the available methods that can be called by an object
_ -- Last output
? <Object> -- Shows more information (doc) about an object, or method
cat <File> -- Display the content of a file
_file_ -- Represent the last file Pry touched
wtf? -- Print the stack trace, same as _ex_.backtrace
$ -- Show source, shortcut for show-source
edit <Method> -- Open file in $EDITOR, change file are auto reloaded
<ctrl+r> -- Search history
_out_ -- Array of all outputs values, also _in_
cd <var> -- Step into an object, change the value of self
cd .. -- Take out of a level
binding.pry -- Breakpoint
edit --ex -- Edit the file where the last exception was thrown
.<Shell> -- Runs the <Shell> command
whereami -- Print the context where the debugger is stopped
; -- Would mute the return output by Ruby
play -l -- Execute the line in the current debugging context
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment