module Guard::Compat::UI

def self.color(text, *colors)

def self.color(text, *colors)
  if Guard.const_defined?(:UI)
    Guard::UI.send(:color, text, *colors)
  else
    text
  end
end

def self.color_enabled?

def self.color_enabled?
  if Guard.const_defined?(:UI)
    Guard::UI.send(:color_enabled?)
  else
    false
  end
end

def self.debug(message, options = {})

def self.debug(message, options = {})
  if Guard.const_defined?(:UI)
    Guard::UI.debug(message, options)
  else
    $stdout.puts(message)
  end
end

def self.deprecation(message, options = {})

def self.deprecation(message, options = {})
  if Guard.const_defined?(:UI)
    Guard::UI.deprecation(message, options)
  else
    $stdout.puts(message)
  end
end

def self.error(message, options = {})

def self.error(message, options = {})
  if Guard.const_defined?(:UI)
    Guard::UI.error(message, options)
  else
    $stderr.puts(message)
  end
end

def self.info(message, options = {})

def self.info(message, options = {})
  if Guard.const_defined?(:UI)
    Guard::UI.info(message, options)
  else
    $stdout.puts(message)
  end
end

def self.notify(msg, options = {})

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

def self.warning(message, options = {})

def self.warning(message, options = {})
  if Guard.const_defined?(:UI)
    Guard::UI.warning(message, options)
  else
    $stdout.puts(message)
  end
end