ruby , pry 开: Can I add something to the command `pry example.rb` so pry automatically goes interactive when it finishes executing the script?

标签 ruby command-line-arguments read-eval-print-loop pry interactive-mode

如果 Pry 遇到异常(例如,如果您只是将 undefined variable “x”放在脚本末尾),则会进入交互模式。

(此外,如果在脚本本身内,您需要“pry”,并将 binding.pry 放在您想要进行交互的位置。)

但我想知道:当我在命令提示符下输入它时,是否可以将某种标志/选项/参数添加到 pry example.rb 命令中,这样它就会当执行任何 example.rb 脚本结束时,无论里面有什么,都进入交互状态吗? (当然,假设在结束之前没有异常(exception)。)

(这显然对于可以从 Notepad++ 等运行外部程序的编辑器使用特别有用,请参阅 thisthis 。)

最佳答案

还没有,但请提交 issue我会添加它:)

关于 ruby , pry 开: Can I add something to the command `pry example.rb` so pry automatically goes interactive when it finishes executing the script?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16212147/

相关文章:

c++ - QCommandLine选项 : How to parse the same parameter multiple times?

lisp - CLISP 的 REPL 中有哪些魔法变量?

python - 在输入提示中启用箭头键导航

ruby - 在 REPL 或 irb 中重用 Ruby DSL?

ruby - 如何在 Ruby 中定义未命名方法?

ruby - 我如何在 capybara 中单击此按钮(使用 'ID' 或 'Xpath' 选择器)

ruby-on-rails - Authlogic记录方法。这是做什么的

html - Erb:如何让一个 block 水平重复?

linux - 具有多个参数的 xargs

gcc - 如何使用 gnu Make 确定 --load-average 的良好值?