Module: Herald::Watcher::Notifier::Growl
- Defined in:
- lib/herald/notifiers/growl.rb
Constant Summary collapse
- @@notification_type =
"Herald Notification"
Class Method Summary collapse
Instance Method Summary collapse
-
#notify(item) ⇒ Object
send a Growl notification.
- #parse_options(options) ⇒ Object
-
#test ⇒ Object
no tests for Growl.
Class Method Details
.extended(base) ⇒ Object
9 10 11 12 13 14 |
# File 'lib/herald/notifiers/growl.rb', line 9 def self.extended(base) Herald.lazy_load('ruby-growl') class << base attr_accessor :growl, :sticky end end |
Instance Method Details
#notify(item) ⇒ Object
send a Growl notification
28 29 30 31 32 33 34 35 |
# File 'lib/herald/notifiers/growl.rb', line 28 def notify(item) begin @growl.notify(@@notification_type, item.title, item., @priority, @sticky) rescue Errno::ECONNREFUSED => e # TODO throw custom exception raise "Growl settings not configured to allow remote application registration. See Growl website docs: http://growl.info/documentation/exploring-preferences.php" end end |
#parse_options(options) ⇒ Object
16 17 18 19 20 21 22 |
# File 'lib/herald/notifiers/growl.rb', line 16 def () @sticky = .delete(:sticky) || false @priority = .delete(:priority) || 1 host = .delete(:host) || "localhost" pass = .delete(:pass) || nil @growl = ::Growl.new(host, "Herald", [@@notification_type], [@@notification_type], pass) end |
#test ⇒ Object
no tests for Growl
25 |
# File 'lib/herald/notifiers/growl.rb', line 25 def test; end |