From: Jason Mayer Date: 2006-12-31T14:56:16+09:00 Subject: Re: Ruby for Windows:How does one not echo keyboard input? ------=_Part_137596_9370171.1167544574306 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline On 12/30/06, Jacob, Raymond A Jr wrote: > > Firstly, I appologize if this question has already been answered but I > could not figure out the > 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 > 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, > raymond > > page 791 and 792 of the ruby cookbook covers this. require 'rubygems' require 'highline/import' def get_password(prompt='Password: ') ask(prompt) { |q| q.echo = false} end get_password("What's your password?") ------=_Part_137596_9370171.1167544574306--