tags:

views:

216

answers:

2

I am new to ruby. I need to receive password as an input through gets command.

How do I hide the password input typed in the terminal, during gets call

+2  A: 

There is a library called highline which works like this:

require 'rubygems'
require 'highline/import'

password = ask("Enter password: ") { |q| q.echo = false }
# do stuff with password
Otto Allmendinger
A: 

this is another alternative.

ghostdog74
Thanks..exactly I was looking for
jsampath