_gets_noecho()public
No documentation available.
# File lib/rubygems/user_interaction.rb, line 325
def _gets_noecho
require_io_console
if IO.method_defined?(:noecho) then
@ins.noecho {@ins.gets}
elsif Gem.win_platform?
require "Win32API"
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
password
else
system "stty -echo"
begin
@ins.gets
ensure
system "stty echo"
end
end
end