e$B$J$+$@$G$9!#e(B
lib/net/imap.rbe$B$rD>@<B9T$9$k$H;H$($k4J0We(BIMAPe$B%/%i%$%"%s%H$r!"%Qe(B
e$B%9%o!<%I$NF~NO$Ke(BIO#noechoe$B$r;H$&$h$&$K$7$F$_$^$7$?!#$^$?!"<B:]$Ke(B
e$BI,MW$K$J$k$^$G%Q%9%o!<%I$NF~NO$rCY$i$;$k$h$&$K$b$7$F$$$^$9!#e(B
Index: lib/net/imap.rb
— lib/net/imap.rb (revision 28780)
+++ lib/net/imap.rb (working copy)
@@ -3485,12 +3485,27 @@
end
- begin
- require ‘io/console’
- rescue LoadError
- def _noecho(&block)
-
system("stty", "-echo")
-
begin
-
yield STDIN
-
ensure
-
system("stty", "echo")
-
end
- end
- else
- def _noecho(&block)
-
STDIN.noecho(&block)
- end
- end
- def get_password
print "password: "
- system(“stty”, “-echo”)
begin -
return gets.chop
-
ensurereturn _noecho(&:gets).chomp
-
system("stty", "echo")
-
print "\n"
-
endputs
end
@@ -3543,5 +3558,7 @@
imap = Net::IMAP.new($host, :port => $port, :ssl => $ssl)
begin
- password = get_password
- class << password = method(:get_password)
-
alias to_str call
- end
imap.authenticate($auth, $user, password)
while true