Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to stop binding.pry from executing inside a loop?

Tags:

ruby

pry

Consider the following code:

require 'pry'
(1..5).each {                                                                                       
  binding.pry                                                                                     
  puts 'test'                                                                                       
}

After getting into first pry's session I want to continue running the script as if binding.pry is not there. Even when I edit the file not leaving the session, commenting the line out, and type exit or continue, it's invoked nevertheless.

like image 892
x-yuri Avatar asked Oct 24 '25 04:10

x-yuri


2 Answers

You can use !!! or exit-program (exit-p), but it will raise an exception.

like image 68
AlexMrKlim Avatar answered Oct 25 '25 18:10

AlexMrKlim


Another Solution is disable-pry

like image 28
Maged Makled Avatar answered Oct 25 '25 18:10

Maged Makled