Module: Guard::Compat::UI
- Defined in:
- lib/guard/compat/plugin.rb
Class Method Summary collapse
- .color(text, *colors) ⇒ Object
- .color_enabled? ⇒ Boolean
- .debug(message, options = {}) ⇒ Object
- .deprecation(message, options = {}) ⇒ Object
- .error(message, options = {}) ⇒ Object
- .info(message, options = {}) ⇒ Object
- .notify(msg, options = {}) ⇒ Object
- .warning(message, options = {}) ⇒ Object
Class Method Details
.color(text, *colors) ⇒ Object
55 56 57 58 59 60 61 |
# File 'lib/guard/compat/plugin.rb', line 55 def self.color(text, *colors) if Guard.const_defined?(:UI) Guard::UI.send(:color, text, *colors) else text end end |
.color_enabled? ⇒ Boolean
63 64 65 66 67 68 69 |
# File 'lib/guard/compat/plugin.rb', line 63 def self.color_enabled? if Guard.const_defined?(:UI) Guard::UI.send(:color_enabled?) else false end end |
.debug(message, options = {}) ⇒ Object
95 96 97 98 99 100 101 |
# File 'lib/guard/compat/plugin.rb', line 95 def self.debug(, = {}) if Guard.const_defined?(:UI) Guard::UI.debug(, ) else $stdout.puts() end end |
.deprecation(message, options = {}) ⇒ Object
103 104 105 106 107 108 109 |
# File 'lib/guard/compat/plugin.rb', line 103 def self.deprecation(, = {}) if Guard.const_defined?(:UI) Guard::UI.deprecation(, ) else $stdout.puts() end end |
.error(message, options = {}) ⇒ Object
87 88 89 90 91 92 93 |
# File 'lib/guard/compat/plugin.rb', line 87 def self.error(, = {}) if Guard.const_defined?(:UI) Guard::UI.error(, ) else $stderr.puts() end end |
.info(message, options = {}) ⇒ Object
71 72 73 74 75 76 77 |
# File 'lib/guard/compat/plugin.rb', line 71 def self.info(, = {}) if Guard.const_defined?(:UI) Guard::UI.info(, ) else $stdout.puts() end end |
.notify(msg, options = {}) ⇒ Object
111 112 113 114 115 116 117 118 119 120 121 |
# File 'lib/guard/compat/plugin.rb', line 111 def self.notify(msg, = {}) return $stdout.puts(msg) unless Guard.const_defined?(:UI) return Notifier.notify(msg, ) if Notifier.respond_to?(:notify) # test helper was included note = 'NOTE: Notification is disabled when testing Guard plugins'\ ' (it makes no sense)' $stderr.puts(note) $stdout.puts(msg) end |