问题
When I put the following line into ~/.pryrc
it doesn't work as expected:
Pry.config.prompt_name = Time.now.to_s
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)?
回答1:
You need to use prompt
not prompt_name
Pry.config.prompt = Proc.new { |output, value| Time.now.to_s[0..-6] }
来源:https://stackoverflow.com/questions/22084481/how-can-i-set-my-pry-prompt-to-be-the-current-timestamp