Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我需要一种从 highline 中包含的 ask 方法中删除换行符的方法。这是我当前的代码:
pass = ask( "Enter your password > " ) { |passman| passman.echo = false }
但是每当我运行那个时,输出就是
Enter your password > (typing goes here)
我希望它没有换行符。有什么建议么?
医生:highline说:
如果提供的语句以空格或制表符结尾,则不会附加换行符(输出将是 flush()ed)。
所以用空格试试: