How many times have you thought that debugging is difficult so instead of finding out how to do it you simply started adding puts "var value: #{some_var}"
all over your code and even external gems code!
Well i have news for you guys, ruby debug from your terminal is easy.
All you need to start is requiring 'debug'
when calling your ruby script or ruby binary:
ruby -r debug your_program.rb
Below, take a look at how i debugged thor gem to add a new config option:
I executed some thor script with ruby -rdebug script.rb
then:
1 2 3 4 5 6 7 8 9 |
|
Play around in that console as you normally do with irb and..
have fun!!