Pry is a read-eval-print-loop (REPL) that can be used as an IRB replacement. It has a smooth, bash-like interface for navigating objects in your running application. It also has an extensible plugin system. I’ve written about pry before on this blog. Over the last few months, I’ve found a few new nuggets of pry goodness that I’d like to share.
Pry has great support for plugins. A quick query on rubygems.org will show you a list. (I find this list to be more inclusive than the one on Pry’s wiki.) Here are some of the plugins that I’ve found most useful.
Replaces the rails console with a pry session.
Connects to Pry remotely using DRb. This is very useful for Rails development. I’ve found myself using this a lot for things like development servers running in
fore or code running in my
capybara tests. Recently, I’ve used pry-remote to send commands over from a
guard to do live code reloading. It really helps on the turn-around time when tweaking values and behaviors in a game (but that’s another post entirely).
continue commands to control execution.
Lets you browse Ruby source (including C) directly from the console.
Takes advantage of the new stdlib io-console library to provide live syntax highlighting for user input. A nifty little Readline replacement.
Hacks in special syntax for easily accessing instance variables and private methods.
This gem packages many of the more useful pry plugin gems together with pry for a one-stop-shop addition to your Gemfile.
Pry is still amazing. With more plugins being developed each day, what are you waiting for?