1/13/2024 0 Comments Download ruby debugger![]() ![]() The debugger executes in the same scope as the debugger instruction, so you can view and manipulate any variables available there. This can be useful if you really want to dig through Rails internals, but for most purposes I find step impractical. Using the same controller code as before, see how step has a different effect: /Users/jcasimir/Dropbox/Projects/jsmerchant/app/controllers/products_controller.rb:19Įxecution has now paused inside the implementation of. The step command, on the other hand, will move the execution marker to the next instruction to be executed even in a called method. It advances from the if to the redirect_to. Users/jcasimir/Dropbox/Projects/jsmerchant/app/controllers/products_controller.rb:22 See how next moves the execution marker: /Users/jcasimir/Dropbox/Projects/jsmerchant/app/controllers/products_controller.rb:19 save redirect_to, :notice => "Successfully created product." #. Given this controller code:ĭef create = Product. The next instruction will run the following instruction in the current context and move the marker to the next line in that context. The list instructions shows the context of the current code, five lines before and four lines after the current execution point. Quit will halt execution without finishing the request. Rarely you want to exit the application all together. Just issue the continue instruction and execution will keep running from wherever it paused. Say you figure out the issue and you're ready to finish the request. ![]() Now you have incredible power available to you with a few simple commands. Line 3: The next line of code pending execution. ![]() ![]() Line 2: The line of code containing the call to debugger.path/to/your/app/controllers/products_controller.rb:19 If you're in the middle of a request this console will appear in the window/process where your server is normally outputting it's logging information: INFO WEBrick::HTTPServer#start: pid=78725 port=3000 If it is properly loaded, execution will pause and drop you into the debugger interface. If the debugger is not loaded when execution hits the debugger line, there will be a warning in the output log. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |