ruby-changes:16804
From: nobu <ko1@a...>
Date: Fri, 30 Jul 2010 14:51:04 +0900 (JST)
Subject: [ruby-changes:16804] Ruby:r28799 (trunk): * lib/net/imap.rb: load io/console.
nobu 2010-07-30 14:50:54 +0900 (Fri, 30 Jul 2010) New Revision: 28799 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=28799 Log: * lib/net/imap.rb: load io/console. Modified files: trunk/lib/net/imap.rb Index: lib/net/imap.rb =================================================================== --- lib/net/imap.rb (revision 28798) +++ lib/net/imap.rb (revision 28799) @@ -2001,9 +2001,9 @@ BEG_REGEXP = /\G(?:\ (?# 1: SPACE )( +)|\ -(?# 2: NIL )(NIL)(?=[\x80-\xff(){ \x00-\x1f\x7f%*"\\\[\]+])|\ -(?# 3: NUMBER )(\d+)(?=[\x80-\xff(){ \x00-\x1f\x7f%*"\\\[\]+])|\ -(?# 4: ATOM )([^\x80-\xff(){ \x00-\x1f\x7f%*"\\\[\]+]+)|\ +(?# 2: NIL )(NIL)(?=[\x80-\xff(){ \x00-\x1f\x7f%*#{'"'}\\\[\]+])|\ +(?# 3: NUMBER )(\d+)(?=[\x80-\xff(){ \x00-\x1f\x7f%*#{'"'}\\\[\]+])|\ +(?# 4: ATOM )([^\x80-\xff(){ \x00-\x1f\x7f%*#{'"'}\\\[\]+]+)|\ (?# 5: QUOTED )"((?:[^\x00\r\n"\\]|\\["\\])*)"|\ (?# 6: LPAR )(\()|\ (?# 7: RPAR )(\))|\ @@ -3486,6 +3486,23 @@ EOF 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: " begin -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/