Get to know Pry Ruby gem

Get to know Pry Ruby gem
Average rating: 0
(0 votes)

Thanks! You’ve rated this material!

Pry is an IRB alternative and runtime developer console. Pry features syntax highlighting, a flexible plugin architecture, runtime invocation and source, and documentation browsing. This is a powerful alternative to the standard IRB shell for Ruby. While Pry-Rails was included in the list of the most used Ruby gems of all the time, we’d like you to know that it heavily depends on Pry. And today we want you to get to know Pry Ruby gem.

In a nutshell, Pry is a type of REPL. REPL stands for Read, Evaluate, Print, Loop. It is an interactive programming environment that takes a user’s input, evaluates it and returns the result to the user.

Neat Pry commands you should know:

  1. Pry’s hist command enables you to view, search, and replay history, among other things.
  2. --replay option we can re-evaluate expression(s).
  3. To fix errors in multiple-line expressions into Pry we use the amend-line command.
  4. Pry gives us the possibility of changing methods on the fly using the edit command.
  5. find-method for looking up methods/objects whose names you do not remember.
  6. show-model command lists the model attributes and class associations.

And more of them here. Explore Pry on its official website and on GitHub. Learn to debug with Pry.

Ask Syndicode about Ruby on Rails development! We’d love to help you!

Rate this article, if you like it

Thanks! You’ve rated this material!

Got a project? Let's discuss it!

    Kyiv Sofiivska 1/2a, 01001, Kyiv, Ukraine
    Dnipro Hlinky 2, of. 1003, 49000, Dnipro, Ukraine
    Kharkiv Otakara Yarosha 22, 61000, Kharkiv, Ukraine