If I want to read a simple string from keyboard:
simple_text = gets
What if a password needs to be read from keyboard (commando line)?
How do I mask it with asterisks?
Regards,
Bruno
--
Posted via http://www.ruby-forum.com/.
Try thinking of it like this:
every time a key is pressed on the keyboard, you want to:
print "*"
I don't have time right now to mock up an example, but that might get you started.
This can help you:
http://stackoverflow.com/questions/133719/how-to-read-a-password-in-ruby
pwd = ask("Enter your password: " ) {|c| c.echo=false; c.echo='*';}
puts "the password=#{pwd}"