I am trying to randomize the echo character in the Highline gem's ask
method, but could not get it to work. Did I not do this right?
srand
ask("password: ") { |q| q.echo = ('a'.ord+rand(26)).chr }
The character is randomized for each ask()
call, but not each character. The first run will echo the same character, i.e. 'cccc'. The next run will echo 'mmmm', etc.