ruby/debug - a small tip to print variable before breakpoint
A small tip: when using the Ruby debug
gem
To shorten the debug time, I like to add a puts <var>
at the end
of binding.break
.
i
will also display information about all variables, but when there
are many, it is easier to display the last one and then look up.
There is also the option to not use puts
but directly call a
:Â
binding.break(pre: 'ls ;; i ;; a')
But adding a puts
or even a p
to print the variable will remove some
collisions with debug own commands.Â