Forum: Ruby Hide "gets" method output, for passwords..

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
3af9b1c30beee755b32c660d6687537a?d=identicon&s=25 Brian Wallace (Guest)
on 2009-04-09 22:23
(Received via mailing list)
HI All,

 I'm trying to find a platform independent way of hiding the STDOUT when
a
password is being entered via the gets method...
I was able to hide all output in Linux by using Termios , but as you
know
this doesn't work on Windows..

What would be nice , is a simple implementation of asterisks replacing
the
actual characters displayed to STDOUT ...

Does anyone know if this is possible in Ruby?

 Thanks,

draygen
B1b1d33e0655e841d4fd8467359c58d0?d=identicon&s=25 Yossef Mendelssohn (Guest)
on 2009-04-09 23:07
(Received via mailing list)
On Apr 9, 3:22 pm, Brian Wallace <drayge...@gmail.com> wrote:
> What would be nice , is a simple implementation of asterisks replacing the
> actual characters displayed to STDOUT ...
>
> Does anyone know if this is possible in Ruby?

I'm not sure because I haven't done this sort of thing myself, but I
imagine the highline gem is a good place to look.

http://highline.rubyforge.org/
3afd3e5e05dc9310c89aa5762cc8dd1d?d=identicon&s=25 Tim Hunter (Guest)
on 2009-04-09 23:10
(Received via mailing list)
Brian Wallace wrote:
> Does anyone know if this is possible in Ruby?
>
>  Thanks,
>
> draygen
>

I think Highline will do this: http://highline.rubyforge.org
This topic is locked and can not be replied to.