Class: Burr::UI
Instance Attribute Summary collapse
-
#shell ⇒ Object
Returns the value of attribute shell.
Instance Method Summary collapse
- #confirm(msg, newline = nil) ⇒ Object
- #debug(msg, newline = nil) ⇒ Object
- #error(msg, newline = nil) ⇒ Object
- #info(msg, newline = nil) ⇒ Object
-
#initialize ⇒ UI
constructor
A new instance of UI.
- #trace(e, newline = nil) ⇒ Object
- #warn(msg, newline = nil) ⇒ Object
Constructor Details
#initialize ⇒ UI
Returns a new instance of UI.
8 9 10 11 |
# File 'lib/burr/ui.rb', line 8 def initialize Thor::Base.shell = Thor::Shell::Basic if !STDOUT.tty? @shell = Thor::Base.shell.new end |
Instance Attribute Details
#shell ⇒ Object
Returns the value of attribute shell.
6 7 8 |
# File 'lib/burr/ui.rb', line 6 def shell @shell end |
Instance Method Details
#confirm(msg, newline = nil) ⇒ Object
17 18 19 |
# File 'lib/burr/ui.rb', line 17 def confirm(msg, newline = nil) tell_me(msg, :green, newline) end |
#debug(msg, newline = nil) ⇒ Object
29 30 31 |
# File 'lib/burr/ui.rb', line 29 def debug(msg, newline = nil) tell_me(msg, nil, newline) if debug? end |
#error(msg, newline = nil) ⇒ Object
25 26 27 |
# File 'lib/burr/ui.rb', line 25 def error(msg, newline = nil) tell_me(msg, :red, newline) end |
#info(msg, newline = nil) ⇒ Object
13 14 15 |
# File 'lib/burr/ui.rb', line 13 def info(msg, newline = nil) tell_me(msg, nil, newline) end |
#trace(e, newline = nil) ⇒ Object
33 34 35 36 |
# File 'lib/burr/ui.rb', line 33 def trace(e, newline = nil) msg = ["#{e.class}: #{e.}", *e.backtrace].join("\n") tell_me(msg, nil, newline) end |
#warn(msg, newline = nil) ⇒ Object
21 22 23 |
# File 'lib/burr/ui.rb', line 21 def warn(msg, newline = nil) tell_me(msg, :yellow, newline) end |