debugging - 如何将 Pry 提示设置为当前时间戳?

标签 debugging configuration pry pry-rails

当我将以下行放入 ~/.pryrc 中时,它无法按预期工作:

Pry.config.prompt_name = Time.now.to_s

每次提示都等于 Pry 启动的时间。

每次显示提示时(每次调用后),如何使用当前时间戳更新提示?

最佳答案

您需要使用prompt而不是prompt_name

Pry.config.prompt = Proc.new { |output, value| Time.now.to_s[0..-6] } 

关于debugging - 如何将 Pry 提示设置为当前时间戳?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22084481/

相关文章:

c# - 你如何使用 c# 4.0 app.config 中的部分?

ruby - BasicObject 中的 binding.pry

ruby-on-rails - 使用 Rails 控制台时 pry-stack_explorer 中的 NoMethodError

ruby-on-rails - 带有乘客的 Controller 中的 Binding.pry

python - 在 org 模式下调试 PYTHON 代码块 babel

Angular 2 : How enable debugging in angular2 from browser console

debugging - 如何解释WinDbg中显示的异常代码?

c++ - qt 应用程序崩溃但不容易重现,我已经捕获了转储堆栈以及如何通过堆栈查找源代码

configuration - TortoiseHg无法提交--"The system cannot find the file specified"

c++ - 如何手动将选项插入 boost.Program_options?