Guest User

Untitled

a guest
Dec 12th, 2018
60
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.17 KB | None | 0 0
  1. Pry Cheat Sheet
  2. Youtube Tutorial 2013
  3. Command Line
  4.  
  5. pry -r ./config/app_init_file.rb - load your app into a pry session (look at the file loaded by config.ru)
  6. pry -r ./config/environment.rb - load your rails into a pry session
  7. Debugger
  8.  
  9. help ls -- Display command options for pry command ls
  10. ls <Object> -- Show all of the available methods that can be called by an object
  11. _ -- Last eval
  12. ? <Object> -- Shows more information (doc) about an object, or method
  13. _file_ -- Represent the last file Pry touched
  14. wtf? -- Print the stack trace, same as _ex_.backtrace
  15. $ -- Show source, shortcut for show-source
  16. edit Class -- Open file in $EDITOR
  17. edit Class#instance_method -- Open file in $EDITOR
  18. <ctrl+r> -- Search history
  19. _out_ -- Array of all outputs values, also _in_
  20. cd <var> -- Step into an object, change the value of self
  21. cd .. -- Take out of a level
  22. binding.pry -- Breakpoint
  23. edit --ex -- Edit the file where the last exception was thrown
  24. .<Shell> -- Runs the command
  25. whereami -- Print the context where the debugger is stopped
  26. whereami 20 -- Print the context 20 lines where the debugger is stopped
  27. ; -- Would mute the return output by Ruby
  28. play -l -- Execute the line in the current debugging context
Add Comment
Please, Sign In to add comment