Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

binding.irb is indeed a superpower of Ruby (and its equivalent in a few other enlightened languages).

binding.pry is even better, and worth the gem install.

  irb : sh :: pry : zsh


While this was true for a long time, Ruby's built in irb and debug gems have improved dramatically in the past couple of years. To the point that I've switched to them from pry+byebug that I've been using for years.


One advantage of byebug is that if you do a sleep in something with theeads like capybara tests, the browser becomes functional again. Which is not the case with irb/debug. I couldn't find a way to reproduce this behavior in recent debuggers.


Can you do things like `next`, `step`, `up` or `caller` to go up/down the callstack like you can with pry?


Yes, you can with irb:debug, which you can enter by typing debug one you're inside a binding.irb session.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: