diff options
Diffstat (limited to 'lib/rubygems/user_interaction.rb')
-rw-r--r-- | lib/rubygems/user_interaction.rb | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/lib/rubygems/user_interaction.rb b/lib/rubygems/user_interaction.rb index 9f0538a6b0..0172c4ee89 100644 --- a/lib/rubygems/user_interaction.rb +++ b/lib/rubygems/user_interaction.rb @@ -193,7 +193,7 @@ class Gem::StreamUI # then special operations (like asking for passwords) will use the TTY # commands to disable character echo. - def initialize(in_stream, out_stream, err_stream=STDERR, usetty=true) + def initialize(in_stream, out_stream, err_stream=$stderr, usetty=true) @ins = in_stream @outs = out_stream @errs = err_stream @@ -237,6 +237,7 @@ class Gem::StreamUI return nil, nil unless result result = result.strip.to_i - 1 + return nil, nil unless (0...list.size) === result [list[result], result] end @@ -590,8 +591,8 @@ class Gem::StreamUI end ## -# Subclass of StreamUI that instantiates the user interaction using STDIN, -# STDOUT, and STDERR. +# Subclass of StreamUI that instantiates the user interaction using $stdin, +# $stdout, and $stderr. class Gem::ConsoleUI < Gem::StreamUI ## @@ -599,7 +600,7 @@ class Gem::ConsoleUI < Gem::StreamUI # stdin, output to stdout and warnings or errors to stderr. def initialize - super STDIN, STDOUT, STDERR, true + super $stdin, $stdout, $stderr, true end end |