Module: Hitcher::UserPrompt

Included in:
CliOps::RunOps
Defined in:
lib/hitcher/user_prompt.rb

Instance Method Summary collapse

Instance Method Details

#fatal(str) ⇒ Object



31
32
33
# File 'lib/hitcher/user_prompt.rb', line 31

def fatal(str)
  STDERR.puts(str.red)
end

#no(str) ⇒ Object



27
28
29
# File 'lib/hitcher/user_prompt.rb', line 27

def no(str)
  STDOUT.puts(str.yellow)
end

#notice(str) ⇒ Object



19
20
21
# File 'lib/hitcher/user_prompt.rb', line 19

def notice(str)
  STDOUT.print(str.light_blue)
end

#question(str) ⇒ Object



15
16
17
# File 'lib/hitcher/user_prompt.rb', line 15

def question(str)
  STDOUT.print(str)
end

#ttyObject



8
9
10
11
12
13
# File 'lib/hitcher/user_prompt.rb', line 8

def tty
  if @tty.nil?
    @tty = TTY::Prompt.new
  end
  @tty
end

#yes(str) ⇒ Object



23
24
25
# File 'lib/hitcher/user_prompt.rb', line 23

def yes(str)
  STDOUT.puts(str.green)
end