Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Difference between pry and pry-rails

What is the difference (implementation wise) in pry gem and pry-rails gem?

like image 711
Prathamesh Sonpatki Avatar asked Jul 29 '12 14:07

Prathamesh Sonpatki


People also ask

What is pry in rails?

Pry is a runtime developer console and IRB alternative with powerful introspection capabilities. Pry aims to be more than an IRB replacement. It is an attempt to bring REPL driven programming to the Ruby language.

What is pry gem?

Pry is a ruby gem that offers another interactive programming environment, a REPL, and like IRB, allows you to execute Ruby code in your terminal, where you can see and interact with the results.

What is IRB pry?

Pry is like IRB on steroids Both IRB and Pry use REPL commands: Read, Evaluate, Print, and Loop. But Pry allows you to go further when debugging. For example, Pry gives you color-coded syntax, which helps when you're trying to figure out what will happen when code is executed.


1 Answers

Comparing their implementation doesn't make sense, because they're two different things: an IRb alternative and a plugin to make the former the Rails console.

The pry-rails gem simply adds an initializer to change the Rails console to Pry and adds some Pry commands specific to Rails. Pry-rails depends on Pry, and there's no reason you couldn't use Pry with Rails without pry-rails, it just makes it easier.

like image 130
Andrew Marshall Avatar answered Oct 20 '22 17:10

Andrew Marshall