lib/bolt/notifier.rb in marcinbunsch-bolt-0.2.6 vs lib/bolt/notifier.rb in marcinbunsch-bolt-0.2.7

- old
+ new

@@ -7,29 +7,28 @@ class Notifier attr_accessor :selected # Constructor def initialize - # find appropriate notifier + # find an appropriate notifier notifier # present - $stdout.puts "** Using #{notifier.class} \n" if Bolt['verbose'] + $stdout.puts "** Using #{notifier.class} \n" if Bolt.verbose? end - # Pick a listener to launch + # Pick a notifier to launch 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'] + $stdout.puts "** Found 'notifier' setting in .bolt" if Bolt.verbose? return self.selected end - $stdout.puts "** Determining notifier... \n" if Bolt['verbose'] + $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)