summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-07-30 05:50:54 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-07-30 05:50:54 +0000
commita55567a066b1cf8851da606a1dafbe38f4cec520 (patch)
tree953bcf9165580e88b6f37b4eea30ffe7882588a5 /lib
parent63a555ee4e3bb9e95bdee4c28b64b84e2536a249 (diff)
* lib/net/imap.rb: load io/console.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28799 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib')
-rw-r--r--lib/net/imap.rb23
1 files changed, 20 insertions, 3 deletions
diff --git a/lib/net/imap.rb b/lib/net/imap.rb
index a032a1850d..9de6395236 100644
--- a/lib/net/imap.rb
+++ b/lib/net/imap.rb
@@ -2001,9 +2001,9 @@ module Net
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 @@ usage: #{$0} [options] <host>
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