Method: Gloo::App::Prompt#ask

Defined in:
lib/gloo/app/prompt.rb

#ask(prompt = nil) ⇒ Object

Show the prompt and get input. Use the default prompt if none is provided.



27
28
29
30
31
32
33
34
35
36
37
38
39
40
# File 'lib/gloo/app/prompt.rb', line 27

def ask( prompt=nil )
  prompt ||= default_prompt

  response = Reline.readline( "#{prompt} ", true)

  # I don't like this one because it appends a ':' to the prompt.
  # response = Ask.input prompt

  # This was just the brute force way to do it.
  # puts prompt
  # return $stdin.gets.chomp

  return response
end