Class: Guard::BustedNotifier

Inherits:
Object
  • Object
show all
Defined in:
lib/guard/busted/notifier.rb

Overview

Wrapper for Guard::Notifier to make system notifications

Constant Summary collapse

FAILURE_TITLE =
'Busted - Failure'
SUCCESS_TITLE =
'Busted - Success'

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(message, status) ⇒ BustedNotifier

Initialize BustedNotifier

Parameters:

  • message (String)

    message to parse, output from busted command

  • status (Boolean)

    status of busted command



17
18
19
20
# File 'lib/guard/busted/notifier.rb', line 17

def initialize(message, status)
  @raw_message = message
  @status = status
end

Instance Attribute Details

#raw_messageObject

Returns the value of attribute raw_message.



8
9
10
# File 'lib/guard/busted/notifier.rb', line 8

def raw_message
  @raw_message
end

#statusObject

Returns the value of attribute status.



8
9
10
# File 'lib/guard/busted/notifier.rb', line 8

def status
  @status
end

Instance Method Details

#notifyObject

Send notification to the system

The type of the notification depends on the status of busted command.



25
26
27
28
29
30
31
# File 'lib/guard/busted/notifier.rb', line 25

def notify
  if status
    notify_success
  else
    notify_failure
  end
end