Class: WIP::UI::Shell

Inherits:
WIP::UI show all
Defined in:
lib/wip/ui.rb

Instance Method Summary collapse

Constructor Details

#initialize(shell) ⇒ Shell

Returns a new instance of Shell.



18
19
20
21
# File 'lib/wip/ui.rb', line 18

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

Instance Method Details

#be_quiet!Object



43
44
45
# File 'lib/wip/ui.rb', line 43

def be_quiet!
  @quiet = true
end

#confirm(msg) ⇒ Object



31
32
33
# File 'lib/wip/ui.rb', line 31

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

#debug(msg) ⇒ Object



23
24
25
# File 'lib/wip/ui.rb', line 23

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

#error(msg) ⇒ Object



39
40
41
# File 'lib/wip/ui.rb', line 39

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

#info(msg) ⇒ Object



27
28
29
# File 'lib/wip/ui.rb', line 27

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

#warn(msg) ⇒ Object



35
36
37
# File 'lib/wip/ui.rb', line 35

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