Class: Bolt::Notifier
- Inherits:
-
Object
- Object
- Bolt::Notifier
- Defined in:
- lib/bolt/notifier.rb
Instance Attribute Summary collapse
-
#selected ⇒ Object
Returns the value of attribute selected.
Instance Method Summary collapse
-
#initialize ⇒ Notifier
constructor
Constructor.
-
#notifier ⇒ Object
Pick a notifier to launch.
Constructor Details
Instance Attribute Details
#selected ⇒ Object
Returns the value of attribute selected.
8 9 10 |
# File 'lib/bolt/notifier.rb', line 8 def selected @selected end |
Instance Method Details
#notifier ⇒ Object
Pick a notifier to launch
19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 |
# File 'lib/bolt/notifier.rb', line 19 def notifier return selected if selected if Bolt['notifier'] and ['generic', 'growl'].include?(Bolt['notifier']) self.selected= Bolt::Notifiers::Growl.new if Bolt['notifier'] == 'growl' self.selected= Bolt::Notifiers::Generic.new if Bolt['notifier'] == 'generic' self.selected= Bolt::Notifiers::NotifyOsd.new if Bolt['notifier'] == 'notify_send' $stdout.puts "** Found 'notifier' setting in .bolt" if Bolt.verbose? return self.selected end $stdout.puts "** Determining notifier... \n" if Bolt.verbose? # default - growl (if growlnotify is present) output = %x[which growlnotify] if !Bolt['notifier'] and output.to_s.include?('/growlnotify') self.selected= Bolt::Notifiers::Growl.new(:use_growlnotify => true) end output = %x[which notify-send] if !Bolt['notifier'] and output.to_s.include?('/notify-send') self.selected= Bolt::Notifiers::NotifyOsd.new end # default if else fails if !selected self.selected= Bolt::Notifiers::Generic.new end selected end |