本文介绍了如何将“撬起”提示设置为当前时间戳?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

When I put the following line into ~/.pryrc it doesn't work as expected:

Pry.config.prompt_name = Time.now.to_s

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

Every prompt is equal to the time that Pry was launched.

如何在每次显示提示时(每次通话后)用当前时间戳更新提示?

How do I update the prompt with the current timestamp, each time the prompt is displayed (after each call)?

推荐答案

您需要使用提示而不是提示名称

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

这篇关于如何将“撬起”提示设置为当前时间戳?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-24 18:52
查看更多