module Guard::Compat::UI

Public Class Methods

color(text, *colors) click to toggle source
# 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?() click to toggle source
# 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 = {}) click to toggle source
# File lib/guard/compat/plugin.rb, line 95
def self.debug(message, options = {})
  if Guard.const_defined?(:UI)
    Guard::UI.debug(message, options)
  else
    $stdout.puts(message)
  end
end
deprecation(message, options = {}) click to toggle source
# File lib/guard/compat/plugin.rb, line 103
def self.deprecation(message, options = {})
  if Guard.const_defined?(:UI)
    Guard::UI.deprecation(message, options)
  else
    $stdout.puts(message)
  end
end
error(message, options = {}) click to toggle source
# File lib/guard/compat/plugin.rb, line 87
def self.error(message, options = {})
  if Guard.const_defined?(:UI)
    Guard::UI.error(message, options)
  else
    $stderr.puts(message)
  end
end
info(message, options = {}) click to toggle source
# File lib/guard/compat/plugin.rb, line 71
def self.info(message, options = {})
  if Guard.const_defined?(:UI)
    Guard::UI.info(message, options)
  else
    $stdout.puts(message)
  end
end
notify(msg, options = {}) click to toggle source
# File lib/guard/compat/plugin.rb, line 111
def self.notify(msg, options = {})
  return $stdout.puts(msg) unless Guard.const_defined?(:UI)
  return Notifier.notify(msg, options) 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
warning(message, options = {}) click to toggle source
# File lib/guard/compat/plugin.rb, line 79
def self.warning(message, options = {})
  if Guard.const_defined?(:UI)
    Guard::UI.warning(message, options)
  else
    $stdout.puts(message)
  end
end