aboutsummaryrefslogtreecommitdiffstats
path: root/lib/rubygems/user_interaction.rb
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-09-28 01:16:43 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-09-28 01:16:43 +0000
commitb6139464f544ec511f741f5bbae2fb13adc51c21 (patch)
tree00e91ff57caed712ae08e8b657e8e0a52a030d7c /lib/rubygems/user_interaction.rb
parent69934aeb8d7948c4ca590b7092504c41d8bce6ac (diff)
downloadruby-b6139464f544ec511f741f5bbae2fb13adc51c21.tar.gz
rubygems 2.6.7
* lib/rubygems.rb, lib/rubygems/*, test/rubygems/*: Update rubygems to 2.6.7, not the master, with r56225. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56278 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/rubygems/user_interaction.rb')
-rw-r--r--lib/rubygems/user_interaction.rb28
1 files changed, 13 insertions, 15 deletions
diff --git a/lib/rubygems/user_interaction.rb b/lib/rubygems/user_interaction.rb
index cacd782e08..390d0f2aea 100644
--- a/lib/rubygems/user_interaction.rb
+++ b/lib/rubygems/user_interaction.rb
@@ -7,6 +7,11 @@
require 'rubygems/util'
+begin
+ require 'io/console'
+rescue LoadError
+end
+
##
# Module that defines the default UserInteraction. Any class including this
# module will have access to the +ui+ method that returns the default UI.
@@ -309,21 +314,12 @@ class Gem::StreamUI
password
end
- def require_io_console
- @require_io_console ||= begin
- begin
- require 'io/console'
- rescue LoadError
- end
- true
- end
- end
-
- def _gets_noecho
- require_io_console
- if IO.method_defined?(:noecho) then
+ if IO.method_defined?(:noecho) then
+ def _gets_noecho
@ins.noecho {@ins.gets}
- elsif Gem.win_platform?
+ end
+ elsif Gem.win_platform?
+ def _gets_noecho
require "Win32API"
password = ''
@@ -336,7 +332,9 @@ class Gem::StreamUI
end
end
password
- else
+ end
+ else
+ def _gets_noecho
system "stty -echo"
begin
@ins.gets