at.*_*at. 4 ruby irb read-eval-print-loop pry
我能够使用Pry.config.prompt〜/ .pryrc中的设置自定义Pry的提示,以使Pry更容易为孩子们.现在我想摆脱返回输出:
Enter Ruby code> puts 'hello'
hello
=> nil
Enter Ruby code>
Run Code Online (Sandbox Code Playgroud)
该=> nil是混淆了刚学编程的孩子.我可以抑制Pry中的返回值输出吗?
有几种方法可以做到这一点.无论是添加;到每一行的末尾或替换默认Pry.config.print了proc自己的.例如,添加类似的东西
Pry.config.print = Proc.new { |output, value| }
Run Code Online (Sandbox Code Playgroud)
你~/.pryrc应该做的伎俩.