4. debugger
● Use 'debugger' gem for Ruby 1.9.2 and 1.9.3
● commands
– next
– step
– list
– continue
– break
5. awesome_print
● Ruby library that pretty prints Ruby objects in
full color, exposing their internal structure with
proper indentation.
6. Pry Overview
● Powerful alternative to IRB / debugger
● Source code / documentation browsing
● Syntax highlighting
● Configure via ~/.pryrc
7. Configure Pry
● simple ~/.pryrc
– show Rails/Ruby version in prompt
– add awesome_print gem
8. Use Pry with Rails
● gem 'pry-rails'
● gem 'pry-debugger'
– Adds step, next, continue, ... commands
● gem 'pry-doc'
– Adds docs for Ruby
9. Pry Commands
● show-method
● show-doc
– show-doc Array#join
● ls
● cd
– cd Array; show-doc join
10. Pry Shell Integration
● Open file in editor, run rake task, etc.
● edit
– prepare a block code from your editor. When file is
closed, it will be executed
● edit-method
– Jump to a place in your project, handy for opening
files from gems
14. better_errors
● Replaces the standard Rails error page with a
much better and more useful error page
● Source code inspection for all stack frames
(with syntax highlighting)
● Local and instance variable inspection
● Live REPL on every stack frame
– REPL = read, eval, print, loop
20. git blame
● Find out which commit changed this line
● Helps to understand the reasoning behind the
change
21. git bisect
●
Binary search for commit history
●
Find out exactly when a test started failing, or when an error
started to occur
git bisect start
git bisect good e401315
git bisect bad master
git bisect run rspec spec/models/book_spec.rb
... wait a bit ...
5243cafebabe is the last bad commit