From: "Jacob, Raymond A Jr" Date: 2007-01-01T12:21:53+09:00 Subject: Re: Ruby for Windows:How does one not echo keyboard input? ------_=_NextPart_001_01C72D53.F880B2B0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Jason: Thank you, I guess I should buy the ruby cookbook?=20 Thank you again Raymond ________________________________ From: Jason Mayer [mailto:slamboy@gmail.com] Sent: Sun 12/31/2006 1:23 AM To: Jacob, Raymond A Jr Subject: Re: Ruby for Windows:How does one not echo keyboard input? On 12/31/06, Jason Mayer wrote:=20 On 12/30/06, Jason Mayer wrote: =09 On 12/30/06, Jacob, Raymond A Jr wrote: > > Firstly, I appologize if this question has already been answered = but I=20 > could not figure out the=20 > correct way to word my search on google to find anything relevant. I = am > running Ruby 1.8.2-15 > on windows XP. I used the one-click version. > I am trying to write a script that will prompt a user for a password = and=20 > not echo the characters back to screen. > Is this possible in the dos command window? If so then please give = me a > reference else is there an alternative > such as using TK? > > thank you,=20 > raymond > > page 791 and 792 of the ruby cookbook covers this. =09 require 'rubygems' require 'highline/import' =09 def get_password(prompt=3D'Password: ') ask(prompt) { |q| q.echo =3D false} end =09 get_password("What's your password?") I don't believe this is for windows, but there's a library for it here: =09 =09 http://www.caliban.org/ruby/ruby-password.shtml I also had to do this to get it to work (on the off change you are as = new as I am to ruby) gem install highline=20 =20 ------_=_NextPart_001_01C72D53.F880B2B0--