How do I step out of a loop with Ruby Pry?

前端 未结 9 1075
醉话见心
醉话见心 2020-12-22 15:11

I\'m using Pry with my Rails application. I set binding.pry inside a loop in my model to try and debug a problem. For example:

(1..100).each do          


        
相关标签:
9条回答
  • 2020-12-22 15:53

    To exit everything, use:

    exit!
    

    This should ignore all proceeding bindings.

    0 讨论(0)
  • 2020-12-22 15:53

    Triple exclamation (!!!) would do that.

    0 讨论(0)
  • 2020-12-22 15:55

    To exit Pry unconditionally, type

    exit-program
    

    Edit from @Nick's comment: Also works:

    !!!
    
    0 讨论(0)
提交回复
热议问题