Class: Blertr::NotifySendNotifier
- Defined in:
- lib/blertr/notify_send_notifier.rb
Instance Attribute Summary
Attributes inherited from Notifier
Instance Method Summary collapse
- #alert(message) ⇒ Object
- #can_alert? ⇒ Boolean
-
#initialize ⇒ NotifySendNotifier
constructor
A new instance of NotifySendNotifier.
Methods inherited from Notifier
#in_time_window?, #name, #options, #set_option, #set_time, #will_alert?
Constructor Details
#initialize ⇒ NotifySendNotifier
Returns a new instance of NotifySendNotifier.
5 6 7 8 |
# File 'lib/blertr/notify_send_notifier.rb', line 5 def initialize super @names = ["notify_send"] end |
Instance Method Details
#alert(message) ⇒ Object
10 11 12 |
# File 'lib/blertr/notify_send_notifier.rb', line 10 def alert system("notify-send \"#{.command}\" \"took #{.time_string}\" 2> /dev/null") end |
#can_alert? ⇒ Boolean
14 15 16 17 18 |
# File 'lib/blertr/notify_send_notifier.rb', line 14 def can_alert? rtn = system("which notify-send > /dev/null 2>&1") << "notify-send not availible from $PATH" unless rtn rtn end |