mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* lib/net/imap.rb: load io/console.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28799 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
63a555ee4e
commit
a55567a066
1 changed files with 20 additions and 3 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue