class Guard::Bosh::Notifier

Report success or failure to the user

Public Instance Methods

notify(errors) click to toggle source
# File lib/guard/bosh/notifier.rb, line 7
def notify(errors)
  if errors.empty?
    Guard::Compat::UI.notify(
      'Succeeded', title: 'BOSH', image: :success, priority: -2)
  else
    Guard::Compat::UI.error(error_line(errors))
    Guard::Compat::UI.notify(
      'Failed', title: 'BOSH', image: :failed, priority: 2)
  end
end

Private Instance Methods

error_line(errors) click to toggle source
# File lib/guard/bosh/notifier.rb, line 20
def error_line(errors)
  error = errors.first
  [
    error[:template],
    error[:line] == :unknown ? '?' : error[:line],
    " #{error[:detail]}"
  ].join(':')
end