Learning Outcomes - 31st March

Pry
Pry is a REPL, just like Interactive Ruby (IRB).
That means it Reads input, Evaluates it, Prints the result and Loops (repeats).
A REPL looks something like this:
loop { p eval gets }

Pry as a debugger
Pry can be installed as a gem and used to debug a project. By putting the command binding.pry anywhere in the flow of the program, it will halt the program at that point and start a REPL session where you can use some pry features to debug and find out where the error might be occurring.
You can even change the values of the variables at this stage.
When the program halts, you have access to all the variables that have already been initialized.
After the REPL session exits, the control is returned to the line after the binding command.

Resources
https://github.com/pry/pry
https://medium.com/@DensityLabs/how-to-take-advantage-of-show-source-with-pry-3fb2ce00cc
https://vimeo.com/26391171


Previous
Previous

Learning Outcomes - 02nd April

Next
Next

6th April, 2020 Output