KEMBAR78
Rubyslava debugging with_pry | PDF
Debugging with Pry
Michal Oláh
@michalolah
@bonetics
Progammers spend 60% of
their time debugging
We should pay attention to
our workflow
“There are no fully fledged IDEs for Ruby on
Rails…”

–Agile Web Development with
Rails
-July 2009
WTF
WTF?
WTF?!
Actually its not that bad
we have
tests after all
And puts is a powerfull thing
But what if you meet this
guy?
Commands
!

binding.pry
play
whereami
edit -c
exit
ls
cd
next, previous, skip, breakpoint (debugger)
Demo 1
!
•

debugging integration tests
!

•

fast feedback of what works and what doesn’t
Demo 2
!
•

debugging controller action
!

•

ls, cd
!

•

inplace code edit and debug with breakpoints
!

•

edit, breakpoint, whereami, wtf?!
!

•

debugging with pry-rescue
Plugins and features
•

pry-debugger (MRI 1.8-1.9)

•

pry-byebug (MRI 2.0+)

•

pry-rescue - resque from exceptions in to a pry
session

•

plymounth - jump into a pry session on test failure

•

pry-rails

•

help command

•

pry custom commands
Resources
•

http://pryrepl.org

•

http://gaslight.co/blog/i-like-pry-but-dot-dot-dot

•

http://railscasts.com/episodes/280-pry-with-rails

•

http://www.youtube.com/watch?v=o90CCPjcIKE

•

https://github.com/m1k3/rubyslava_pry_demo

Rubyslava debugging with_pry