Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 120 lines (83 sloc) 3.403 kb
9e546941 »
2009-04-08 Added gem skeleton
1
2 = Growl
3
4 Ruby growlnotify 'bindings'.
5
f9645ae4 »
2009-04-08 Docs
6 == Examples
7
8 notification = Growl.new
9 notification.message = 'Hello World'
10 notification.sticky!
11 notification.icon = :jpeg
4876578f »
2009-04-09 Added examples and updated docs
12 notification.run if Growl.installed?
f9645ae4 »
2009-04-08 Docs
13
14 # OR
15
4876578f »
2009-04-09 Added examples and updated docs
16 Growl.notify {
f9645ae4 »
2009-04-08 Docs
17 self.message = 'Hello World'
18 self.icon = :jpeg
19 sticky!
20 }
21
22 # OR
23
4876578f »
2009-04-09 Added examples and updated docs
24 Growl.notify do |n|
f9645ae4 »
2009-04-08 Docs
25 n.message = 'Hello World'
26 n.icon = :jpeg
27 n.stick!
28 end
29
ce03429d »
2009-04-08 Added #Growl hash support
30 # OR
31
4876578f »
2009-04-09 Added examples and updated docs
32 Growl.notify 'Foo', :icon => :jpeg, :title => 'Growl'
33
34 # OR
35
36 include Growl
37 notify 'Email received', :sticky => true
38
e05a0bda »
2009-04-11 Added #sleep calls to example so they all fire
39 # Convenience methods
4876578f »
2009-04-09 Added examples and updated docs
40
41 notify_ok 'Deployment successful'
42 notify_info 'Email received'
43 notify_warning 'Merge required'
44 notify_error 'Failed to send email', :sticky => true
ce03429d »
2009-04-08 Added #Growl hash support
45
62ac0521 »
2010-11-10 updates readme
46 == Custom path to growlnotify
47
48 If needed you can set a path to the binary with:
49
50 Growl.bin_path = '~/my/path/to/growlnotify'
51
52 right after you require the growl library.
53
7048d19e »
2009-04-13 Growl#notify now normalizes the :icon option key [#2]
54 == Normaized Icons
55
56 The :icon option key is automatically normalized when you use any of the Growl#notify
57 methods, this removes the need to explicitly use :appIcon, :image, etc.
58
59 notify 'App icon', :icon => :Safari
62ac0521 »
2010-11-10 updates readme
60 notify 'Jpeg icon', :icon => :jpeg
61 notify 'Image icon', :icon => 'path/to/image.png'
7048d19e »
2009-04-13 Growl#notify now normalizes the :icon option key [#2]
62 notify 'Icns icon', :icon => 'path/to/icon.icns'
62ac0521 »
2010-11-10 updates readme
63 notify 'Path extname icon', :icon => 'foo.rb'
7048d19e »
2009-04-13 Growl#notify now normalizes the :icon option key [#2]
64
f9645ae4 »
2009-04-08 Docs
65 == Features
66
4876578f »
2009-04-09 Added examples and updated docs
67 * Check availability with Growl.installed?
68 * Check dependencies with Growl.version
f9645ae4 »
2009-04-08 Docs
69 * Use images, icon paths, application icons, or file format icons
62ac0521 »
2010-11-10 updates readme
70 * Sticky a notification making it appear until explicitly closed
71 * Set notification priority
4876578f »
2009-04-09 Added examples and updated docs
72 * Convenience methods such as notify_ok, notify_warning, notify_error, and notify_info
c6ef692d »
2009-04-13 Added growlnotify install docs [#3]
73 * Etc (consult growlnotify --help)
74
75 == Installing growlnotify
76
62ac0521 »
2010-11-10 updates readme
77 Visit http://growl.info/documentation.php for installation help.
f9645ae4 »
2009-04-08 Docs
78
fdb1e24b »
2009-04-09 Excessive notifications docs
79 == Known Issues
80
81 It seems that growlnotify will essentially ignore or block excessive usage
cbdfc6ba »
2009-04-09 Docs
82 of the notifications at random. To prevent this you may need to do something like
83 below if you are calling many in sequence:
fdb1e24b »
2009-04-09 Excessive notifications docs
84
85 notify 'Something'; sleep 0.2
86 notify_ok 'Updated'; sleep 0.2
87 notify_info 'You have new mail'; sleep 0.2
88 notify_warning 'Merged required'; sleep 0.2
89 notify_error 'Oh Noes!'; sleep 0.2
90
03fc6681 »
2009-04-13 Added lighthouse link
91 == Contribute
92
93 Fork / send a pull request or submit a ticket at:
bbba30ac »
2009-04-17 Changed url for ticketing system
94 http://github.com/visionmedia/growl/issues
03fc6681 »
2009-04-13 Added lighthouse link
95
9e546941 »
2009-04-08 Added gem skeleton
96 == License:
97
98 (The MIT License)
99
100 Copyright (c) 2009 TJ Holowaychuk <tj@vision-media.ca>
101
102 Permission is hereby granted, free of charge, to any person obtaining
103 a copy of this software and associated documentation files (the
104 'Software'), to deal in the Software without restriction, including
105 without limitation the rights to use, copy, modify, merge, publish,
106 distribute, sublicense, an d/or sell copies of the Software, and to
107 permit persons to whom the Software is furnished to do so, subject to
108 the following conditions:
109
110 The above copyright notice and this permission notice shall be
111 included in all copies or substantial portions of the Software.
112
113 THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
114 EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
115 MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
116 IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
117 CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
118 TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
119 SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Something went wrong with that request. Please try again.