Byebug Notes day 2 Flashcards
What does byebug do?
Byebug is a debugging tool. using byebug we can pause execution, step through our code one line at a time, take a look inside key variables and methods.
How do you install byebug?
run the following command in your terminal:
[gem install byebug]
what should you do before running your file?
(1) [require “byebug”]- add to the top of your file to gain access to the gem
(2) [debugger] - place this line at a point in your file where you want to begin debugger mod
what does [l -] do
list the line numbers in the specified range
example: l 3-20
what does [step or s]
step into the method call on the current line, if possible
what does [next or n ] do?
- move to the next line of executed code
what does[break or b ] do?
place a breakpoint at the specified line number, this will pause execution again
what does [continue or c] do?
resume normal execution of the code until a breakpoint
what does [display ] do?
automatically show the current value of a variable