如何更改提示

| 我正在尝试在ripl(交互式红宝石(irb)的替代方法)中配置提示字符。在irb中,它是使用
IRB.conf[:DEFAULT]
完成的,但似乎不适用于ripl。我也很难找到有关它的说明。请引导链接进行解释或简要说明。     
已邀请:
在〜/ .riplrc中配置动态提示:
# Shows current directory
Ripl.config[:prompt] = lambda { Dir.pwd + \'> \' }
# Print current line number
Ripl.config[:prompt] = lambda { \"ripl(#{Ripl.shell.line})> \" }
# Simple string prommpt
Ripl.config[:prompt] = \'>>> \'
更改外壳中的提示:
>> Ripl.shell.prompt = lambda { Dir.pwd + \'> \' }
    
  ripl加载〜/ .irbrc文件,该文件   通常包含一些特定的irb   选项(例如IRB.conf [:PROMPT])。至   避免错误,您可以安装   ripl-irb,它可以捕获对   IRB常数并将消息打印到   将irb配置转换为ripl   等价物。 http://rbjl.net/44-ripl-why-should-you-use-an-irb-alternative     

要回复问题请先登录注册