Method deprecated or moved
This method is deprecated or moved on the latest stable version.
The last existing version (v1_9_3_392) is shown here.
ask_for_password_on_windows()
public
Asks for a password that works on windows. Ripped from the Heroku gem.
# File lib/rubygems/user_interaction.rb, line 253
def ask_for_password_on_windows
return nil if not tty?
require "Win32API"
char = nil
password = ''
while char = Win32API.new("crtdll", "_getch", [ ], "L").Call do
break if char == 10 || char == 13 # received carriage return or newline
if char == 127 || char == 8 # backspace and delete
password.slice!(-1, 1)
else
password << char.chr
end
end
puts
password
end