I don't see a way of just going to the next line when using pry as a debugger. All I can find is to edit the method and move binding.pry to the next line. Is there such a feature?
22: def scan path
23: @last_line_had_text, @files_read, @hands_read = nil, 0, 0
24: Find.find(path){ |file_name|
=> 25: binding.pry
26: read_file(file_name) if file_name.include?(".txt")
27: }
28: end
Invoking pry debugging To invoke the debugger, place binding. pry somewhere in your code. When the Ruby interpreter hits that code, execution stops, and you can type in commands to debug the state of the program.
Pry is like IRB on steroids Both IRB and Pry use REPL commands: Read, Evaluate, Print, and Loop. But Pry allows you to go further when debugging. For example, Pry gives you color-coded syntax, which helps when you're trying to figure out what will happen when code is executed.
Ctrl+D, you can jump to next break or exit
Recommend to use pry-byebug
if ruby version >2.0
If you want (this and more) debugging features you'll need to use pry_debug
: https://github.com/Mon-Ouie/pry_debug
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With