vendor/bundle/ruby/1.8/gems/io-reactor-1.0.4/rake/helpers.rb
### Turn echo and masking of input on/off. Based on similar code in
### Ruby-Password by Ian Macdonald <ian@caliban.org>.
Turn echo and masking of input on/off. Based on similar code in
Ruby-Password by Ian Macdonald .
Turn echo and masking of input on / off . Based on similar code in Ruby - Password by Ian Macdonald .
def noecho( masked=false )
	require 'termios'
	rval = nil
	term = Termios.getattr( $stdin )
	begin
		newt = term.dup
		newt.c_lflag &= ~Termios::ECHO
		newt.c_lflag &= ~Termios::ICANON if masked
		Termios.txsetattr( $stdin, Termios::TCSANOW, newt )
		rval = yield
	ensure
		Termios.setattr( $stdin, Termios::TCSANOW, term )
	end
	return rval
end
def noecho ( masked = false ) require 'termios' rval = nil term = Termios . getattr ( $stdin ) begin newt = term . dup newt . c_lflag &= ~ Termios :: ECHO newt . c_lflag &= ~ Termios :: ICANON if masked Termios . txsetattr ( $stdin , Termios :: TCSANOW , newt ) rval = yield ensure Termios . setattr ( $stdin , Termios :: TCSANOW , term ) end return rval end
Turn echo and masking of input on/off.
Turn echo and masking of input on / off .
masked