Pry 中的逐步调试和堆栈导航
[![版本][VersionBadge]][VersionURL]
[![构建][CIBadge]][CIURL]
[![内嵌文档][InchCIBadge]][InchCIURL]
使用 [pry] 添加了逐步调试和堆栈导航功能
[byebug]。
要使用,请正常调用 pry。无需以不同方式启动您的脚本或应用程序。
在您的 binding.pry 之后的第一个语句中,执行将停止。
def some_method
puts 'Hello World' # Run 'step' in the console to move here
end
binding.pry
some_method # Execution will stop here.
puts 'Goodbye World' # Run 'next' in the console to move here.MRI 3.2.0 或更高版本。
添加
gem 'pry-byebug'在 Gemfile 中添加并运行
bundle install如果计划在全局或 :test 组中包含 gem,请确保包含它
可以用它来调试你的测试!
break: 管理断点。
step: 执行到下一行或方法。可选参数为数字,用于多次执行。
down: 将堆栈帧向下移动。可以传入可选的数值参数,以移动多个帧。
暂无开放 Issues,或尚未同步最近议题。