Module: Berkshelf::UI
- Defined in:
- lib/berkshelf/ui.rb
Instance Method Summary collapse
- #deprecated(message) ⇒ Object
- #error(message, color = :red) ⇒ Object (also: #fatal)
- #info(message = '', color = nil, force_new_line = (message.to_s !~ /( |\t)\Z/)) ⇒ Object
-
#mute! ⇒ Object
Mute the output of this instance of UI until #unmute! is called.
- #say(message = '', color = nil, force_new_line = (message.to_s !~ /( |\t)\Z/)) ⇒ Object
- #say_status(status, message, log_status = true) ⇒ Object
-
#unmute! ⇒ Object
Unmute the output of this instance of UI until #mute! is called.
- #warn(message, color = :yellow) ⇒ Object
Instance Method Details
#deprecated(message) ⇒ Object
36 37 38 |
# File 'lib/berkshelf/ui.rb', line 36 def deprecated() warn("[DEPRECATION] #{}") end |
#error(message, color = :red) ⇒ Object Also known as: fatal
40 41 42 43 44 45 |
# File 'lib/berkshelf/ui.rb', line 40 def error(, color = :red) return if quiet? = set_color(, *color) if color super() end |
#info(message = '', color = nil, force_new_line = (message.to_s !~ /( |\t)\Z/)) ⇒ Object
20 21 22 |
# File 'lib/berkshelf/ui.rb', line 20 def info( = '', color = nil, force_new_line = (.to_s !~ /( |\t)\Z/)) say(, color, force_new_line) end |
#mute! ⇒ Object
Mute the output of this instance of UI until #unmute! is called
4 5 6 |
# File 'lib/berkshelf/ui.rb', line 4 def mute! @mute = true end |
#say(message = '', color = nil, force_new_line = (message.to_s !~ /( |\t)\Z/)) ⇒ Object
13 14 15 16 17 |
# File 'lib/berkshelf/ui.rb', line 13 def say( = '', color = nil, force_new_line = (.to_s !~ /( |\t)\Z/)) return if quiet? super(, color, force_new_line) end |
#say_status(status, message, log_status = true) ⇒ Object
24 25 26 27 28 |
# File 'lib/berkshelf/ui.rb', line 24 def say_status(status, , log_status = true) return if quiet? super(status, , log_status) end |
#unmute! ⇒ Object
Unmute the output of this instance of UI until #mute! is called
9 10 11 |
# File 'lib/berkshelf/ui.rb', line 9 def unmute! @mute = false end |
#warn(message, color = :yellow) ⇒ Object
30 31 32 33 34 |
# File 'lib/berkshelf/ui.rb', line 30 def warn(, color = :yellow) return if quiet? say(, color) end |