3

I use byebug debugger to pause execution of a rather lengthy rake task and inspect objects.

Is it possible to add a new completely method and somehow reload the rake task's code while I'm in byebug? For example, add a new method, reload byebug, verify it works, and move on without restarting the rake task..

Thanks!

Alex
  • 453
  • 5
  • 14
  • 2
    Just defining required methods in the buebug console should work just fine. – Uzbekjon Apr 22 '16 at 07:54
  • Hi @Uzbekjon, thanks for your reply. If I try to paste a multi-line method byebug executes each line separately so I get an error. For example, I try pasting: `def try_method(whatever) puts whatever end` _and I get the error_ **SyntaxError Exception: (byebug):1: syntax error, unexpected end-of-input** – Alex Apr 23 '16 at 10:26
  • Hmmm... That's weird. Try to change your multi-line method definition into one liner: `def try_method(whatever); puts whatever; end`. But again, that's weird! :) – Uzbekjon Apr 23 '16 at 11:03
  • Thanks @Uzbekjon. Converting methods into one line is not practical, I might as well stop execution, type the method and re-run the rake task. What about you? can you paste a multiline statement into byebug and run this successfully? – Alex Apr 23 '16 at 13:32

0 Answers0