End of Life Ruby 3.0 has reached end of life and gets no more fixes. Switch to Ruby 4.0 →
instance method
Gem::StreamUI#ask
ask(question)
lib/rubygems/user_interaction.rb
View on GitHub ↗
# File tmp/rubies/ruby-3.0.5/lib/rubygems/user_interaction.rb, line 286
def ask(question)
return nil if not tty?
@outs.print(question + " ")
@outs.flush
result = @ins.gets
result.chomp! if result
result
end
Ask a question. Returns an answer if connected to a tty, nil otherwise.
See also
#alert_warning
#ask_for_password
#alert_error
#ask_yes_no
also in
4.1 · 4.0 · 3.4 · 3.3 · 3.2 · 3.1