49

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
Jeremy Smith
  • 14,727
  • 19
  • 67
  • 114

5 Answers5

78

Ctrl+D, you can jump to next break or exit

mko
  • 21,334
  • 49
  • 130
  • 191
19

Recommend to use pry-byebug if ruby version >2.0

TheOneTeam
  • 25,806
  • 45
  • 116
  • 158
13

If you want (this and more) debugging features you'll need to use pry_debug: https://github.com/Mon-Ouie/pry_debug

deviousdodo
  • 9,177
  • 2
  • 29
  • 34
11

You can also use ruby-debug_pry which integrates pry as a ruby-debug command, enabling you to easily switch back and forth between the two.

A new project called pry-nav is now the recommended way to do this.

horseyguy
  • 29,455
  • 20
  • 103
  • 145
10

If using Using MRI 1.9.2+ then there is a new project, pry-debugger, that is now the recommended replacement for pry-nav. It's by the same author as pry-nav and is faster.

nmott
  • 9,454
  • 3
  • 45
  • 34