# File lib/password.rb, line 208 def Password.getc(message="Password: ", mask='*') # Save current buffering mode buffering = $stdout.sync # Turn off buffering $stdout.sync = true begin Password.echo(false, true) print message if message pw = "" while ( char = $stdin.getc ) != 10 # break after [Enter] putc mask pw << char end ensure Password.echo true print "\n" end # Restore original buffering mode $stdout.sync = buffering Password.new( pw ) end