[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

Hide "gets" method output, for passwords..

Brian Wallace

4/9/2009 8:22:00 PM

[Note: parts of this message were removed to make it a legal post.]

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

2 Answers

Yossef Mendelssohn

4/9/2009 9:01:00 PM

0

On Apr 9, 3:22=A0pm, Brian Wallace <drayge...@gmail.com> wrote:
> What would be nice , is a simple implementation of asterisks replacing th=
e
> 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.ruby...

--
-yossef

Tim Hunter

4/9/2009 9:10:00 PM

0

Brian Wallace wrote:
> 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
>

I think Highline will do this: http://highline.rub...

--
RMagick: http://rmagick.ruby...