当我将以下行放入 ~/.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/