Class: Guard::Pushover
Overview
Send notifications to Pushover
Constant Summary collapse
- DEFAULTS =
{ :title => 'Guard', :priority => 0 }
Instance Method Summary collapse
-
#initialize(watchers = [], options = {}) ⇒ Pushover
constructor
A new instance of Pushover.
- #run_on_additions(paths) ⇒ Object
- #run_on_changes(paths) ⇒ Object
- #run_on_removals(paths) ⇒ Object
Constructor Details
#initialize(watchers = [], options = {}) ⇒ Pushover
Returns a new instance of Pushover.
15 16 17 18 19 20 21 22 23 24 25 |
# File 'lib/guard/pushover.rb', line 15 def initialize(watchers = [], = {}) = DEFAULTS.merge() @user_key = .delete(:user_key) @api_key = .delete(:api_key) @default_message = .delete(:message) @ignore_changes = .delete(:ignore_changes) @ignore_removals = .delete(:ignore_removals) @ignore_additions = .delete(:ignore_additions) super watchers, end |
Instance Method Details
#run_on_additions(paths) ⇒ Object
35 36 37 |
# File 'lib/guard/pushover.rb', line 35 def run_on_additions(paths) send_notification "%s was added.", paths.first unless @ignore_additions end |
#run_on_changes(paths) ⇒ Object
27 28 29 |
# File 'lib/guard/pushover.rb', line 27 def run_on_changes(paths) send_notification "%s was changed.", paths.first unless @ignore_changes end |
#run_on_removals(paths) ⇒ Object
31 32 33 |
# File 'lib/guard/pushover.rb', line 31 def run_on_removals(paths) send_notification "%s was removed.", paths.first unless @ignore_removals end |