Ruby $stdin.gets without showing chars on screen

前端 未结 6 2105
北海茫月
北海茫月 2020-12-30 00:21

I want to ask users to type in a password, but i dont want the chars to appear on screen as they type.

How do I do this in Ruby?

6条回答
  •  醉话见心
    2020-12-30 01:02

    Similar answer as glenn but more complete: http://dmathieu.com/articles/development/ruby-console-ask-for-a-password/

提交回复
热议问题