Pry - An IRb Alternative
Pry is an excellent alternative to IRb with syntax highlighting and proper indentation.
You can install pry
by simply running the command
gem install pry
And then on the command line, run it!
> pry
But the best thing about pry
is that it brings an REPL (read-eval-print-loop) session directly to your code! Just do the following.
require 'pry'
# Code above
binding.pry
#Code below
and it will display the session at the point where you've placed the method. You can play around with your code and then exit with the command exit
.
For more details, check out
* Pry Home
Written by Natansh Verma
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Ruby
Authors
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#