我的.pryrc看起来是这样的:
Pry.config.print = proc { |output, value|
output.puts "# => " + value.inspect ; puts
}
Pry.config.prompt = [
proc { "" },
proc { "" }
]
Pry.config.prompt_name = 'my_project_name'
puts "# " + Time.now.strftime("%H:%M %d-%m-%Y")返回结果时,将对其进行#处理,因此coderay将忽略它们,而不会对它们进行着色。我想给它们涂上颜色。这里有信息:http://coderay.rubychan.de/doc/CodeRay/Encoders/CommentFilter.html
但我想不出来。任何帮助都是非常感谢的。如果我搞清楚了,我会发布解决方案。
编辑:我希望事物被高亮显示,就像#不存在一样(数字一种颜色,字符串另一种和全部,如果返回一个不同的事物数组,则是多种颜色),但是即使只是使返回的全部行一种颜色现在也是有帮助的。谢谢。
发布于 2014-05-12 18:10:17
Pry.config.print = proc { |output, value|
output.puts '# => ' + CodeRay.scan(value, :ruby).encode(:terminal) ; puts
}好像能行啊!
https://stackoverflow.com/questions/23615545
复制相似问题