/
growl.rb
24 lines (16 loc) · 905 Bytes
/
growl.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
$:.unshift File.dirname(__FILE__) + '/../lib'
require 'growl'
Growl.bin_path = ARGV[0] unless ARGV.empty?
puts "using growlnotify located at #{Growl.bin_path}" unless ARGV.empty?
puts "growlnotify version #{Growl.version} installed"
imagepath = File.dirname(__FILE__) + '/../spec/fixtures/image.png'
iconpath = File.dirname(__FILE__) + '/../spec/fixtures/icon.icns'
include Growl
notify_info 'New email received', :sticky => true, :title => 'Some app'; sleep 0.2
notify_ok 'Deployment complete' ; sleep 0.2
notify_error 'Deployment failure' ; sleep 0.2
notify 'Safari icon', :icon => :Safari ; sleep 0.2
notify 'Jpeg icon', :icon => :jpeg ; sleep 0.2
notify 'Image icon', :icon => imagepath ; sleep 0.2
notify 'Icns icon', :icon => iconpath ; sleep 0.2
notify 'Path extname icon', :icon => 'foo.rb' ; sleep 0.2