Can I get through the RoR app? or just debug using a debug checkpoint?

I read that you can put the "debug" symbol in your RoR code, and then execution stops at that moment, and then you can splash something into the console to see the state of the variables, etc.

Is there a way to take a step on each line and follow the execution path?

+3
source share
2 answers

There is documentation in the debugger itself. nand s- these are the teams you are looking for.

(rdb:1) help
ruby-debug help v0.10.3
Type 'help <command-name>' for help on a specific command

Available commands:
backtrace  delete   enable  help    next  quit     show    trace    
break      disable  eval    info    p     reload   source  undisplay
catch      display  exit    irb     pp    restart  step    up       
condition  down     finish  list    ps    save     thread  var      
continue   edit     frame   method  putl  set      tmate   where    

(rdb:1) help next
n[ext][+-]?[ nnn]   step over once or nnn times, 
        '+' forces to move to another line.
        '-' is the opposite of '+' and disables the force_stepping setting.
(rdb:1) help step
s[tep][+-]?[ nnn]   step (into methods) once or nnn times
        '+' forces to move to another line.
        '-' is the opposite of '+' and disables the force_stepping setting.
(rdb:1) 
+5
source

There are some tips for debugging ruby in this Railscast episode .

0

Source: https://habr.com/ru/post/1770187/


All Articles