Class: Strobe::UI::Shell

Inherits:
Basic
  • Object
show all
Defined in:
lib/strobe/ui.rb

Instance Method Summary collapse

Methods inherited from Basic

#ask, #highline, #password

Constructor Details

#initialize(shell) ⇒ Shell

Returns a new instance of Shell.



50
51
52
53
# File 'lib/strobe/ui.rb', line 50

def initialize(shell)
  @shell = shell
  @quiet = false
end

Instance Method Details

#be_quiet!Object



75
76
77
# File 'lib/strobe/ui.rb', line 75

def be_quiet!
  @quiet = true
end

#confirm(msg) ⇒ Object



63
64
65
# File 'lib/strobe/ui.rb', line 63

def confirm(msg)
  @shell.say(msg, :green) if !@quiet
end

#debug(msg) ⇒ Object



55
56
57
# File 'lib/strobe/ui.rb', line 55

def debug(msg)
  @shell.say(msg) if ENV['DEBUG'] && !@quiet
end

#error(msg) ⇒ Object



71
72
73
# File 'lib/strobe/ui.rb', line 71

def error(msg)
  @shell.say(msg, :red)
end

#info(msg) ⇒ Object



59
60
61
# File 'lib/strobe/ui.rb', line 59

def info(msg)
  @shell.say(msg) if !@quiet
end

#warn(msg) ⇒ Object



67
68
69
# File 'lib/strobe/ui.rb', line 67

def warn(msg)
  @shell.say(msg, :yellow)
end