Pry?
Pry is a powerful alternative to the standard
IRB shell for Ruby. It features syntax
highlighting, a flexible plugin architecture,
runtime invocation and source and
documentation browsing.
http://pryrepl.org/
Navigation
Learning about
your context
with the ls
command
Slide 8
Slide 8 text
Navigation
Rapidly
exploring with
the find-method
command
Slide 9
Slide 9 text
Viewing documentation
View method
and class
documentation
with show-doc
Alias ?
Slide 10
Slide 10 text
Viewing code
View method
and class source
code with
show-source
Alias $
Slide 11
Slide 11 text
Editing code
You can use edit-method
Class#method or edit-method
my_method (if the method is
in scope) to open a method
for editing directly in the
default editor. Pry will attempt
to jump to the line in the file
where the method is defined.
Slide 12
Slide 12 text
Runtime invocation
Aside from using Pry as
an IRB-alternative it also
has the ability to
function as a developer
console and lightweight
debugger. To use Pry in
this capacity it must be
invoked at runtime in
the middle of a running
program.
Slide 13
Slide 13 text
Exception handling
Pry catches
most of the
exceptions that
your code raises
so that you have
time to work
out what went
wrong and fix
the problem.