Module: Rakegrowl::Growl

Defined in:
lib/rakegrowl.rb

Class Method Summary collapse

Class Method Details

.exists?Boolean

Returns:

  • (Boolean)


12
13
14
# File 'lib/rakegrowl.rb', line 12

def self.exists?
  !growlnotify.empty?
end

.growlnotifyObject



8
9
10
# File 'lib/rakegrowl.rb', line 8

def self.growlnotify
  `which growlnotify`.chomp
end

.notify(title, message, img_name = nil) ⇒ Object



16
17
18
19
20
# File 'lib/rakegrowl.rb', line 16

def self.notify(title, message, img_name=nil)
  command = "#{growlnotify} -t \"#{title}\" -m \"#{message}\""
  command << " --image \"#{img_name}\"" if img_name
  Kernel.system(command) if exists?
end