在Ruby代码中删除单个断点

Spe*_*cer 14 ruby python debugging ruby-on-rails breakpoints

我试图在python中找到与这些行具有相应功能的ruby代码:

import code
code.interact(local=locals())
Run Code Online (Sandbox Code Playgroud)

这些行实际上是在我的代码中插入一个断点并打开一个控制台,我可以在其中与任何变量进行交互.

有关如何在Ruby中执行此操作的任何想法?

Phr*_*ogz 16

你想要Pry库:

require 'pry' # gem install pry
binding.pry   # Drop into the pry console
Run Code Online (Sandbox Code Playgroud)

点击此处了解更多信息:http:
//banisterfiend.wordpress.com/2011/01/27/turning-irb-on-its-head-with-pry/

另请参见:
如何与Sinatra一起使用Pry?