visionmedia-growl 0.0.6 → 1.0.2
Sign up to get free protection for your applications and to get access to all the features.
- data/History.rdoc +15 -0
- data/Manifest +1 -2
- data/README.rdoc +34 -2
- data/examples/growl.rb +8 -19
- data/{Growl.gemspec → growl.gemspec} +3 -3
- data/lib/growl/growl.rb +34 -2
- data/lib/growl/version.rb +1 -1
- metadata +3 -5
- data/Todo.rdoc +0 -15
data/History.rdoc
CHANGED
@@ -1,4 +1,19 @@
|
|
1
1
|
|
2
|
+
=== 1.0.2 / 2009-04-19
|
3
|
+
|
4
|
+
* Added new gemspec
|
5
|
+
* Removed capitalized gemspec name causing build issues
|
6
|
+
|
7
|
+
=== 1.0.1 / 2009-04-19
|
8
|
+
|
9
|
+
* Changed url for ticketing system
|
10
|
+
|
11
|
+
=== 1.0.0 / 2009-04-13
|
12
|
+
|
13
|
+
* Added new examples
|
14
|
+
* Added growlnotify install docs [#3]
|
15
|
+
* Changed; Growl#notify now normalizes the :icon option key [#2] (checkout README)
|
16
|
+
|
2
17
|
=== 0.0.6 / 2009-04-09
|
3
18
|
|
4
19
|
* Added #notify_{ok,info,warning,error} and images
|
data/Manifest
CHANGED
data/README.rdoc
CHANGED
@@ -36,13 +36,24 @@ Ruby growlnotify 'bindings'.
|
|
36
36
|
include Growl
|
37
37
|
notify 'Email received', :sticky => true
|
38
38
|
|
39
|
-
#Convenience methods
|
39
|
+
# Convenience methods
|
40
40
|
|
41
41
|
notify_ok 'Deployment successful'
|
42
42
|
notify_info 'Email received'
|
43
43
|
notify_warning 'Merge required'
|
44
44
|
notify_error 'Failed to send email', :sticky => true
|
45
45
|
|
46
|
+
== Normaized Icons
|
47
|
+
|
48
|
+
The :icon option key is automatically normalized when you use any of the Growl#notify
|
49
|
+
methods, this removes the need to explicitly use :appIcon, :image, etc.
|
50
|
+
|
51
|
+
notify 'App icon', :icon => :Safari
|
52
|
+
notify 'Jpeg icon', :icon => :jpeg
|
53
|
+
notify 'Image icon', :icon => 'path/to/image.png'
|
54
|
+
notify 'Icns icon', :icon => 'path/to/icon.icns'
|
55
|
+
notify 'Path extname icon', :icon => 'foo.rb'
|
56
|
+
|
46
57
|
== Features
|
47
58
|
|
48
59
|
* Check availability with Growl.installed?
|
@@ -51,7 +62,28 @@ Ruby growlnotify 'bindings'.
|
|
51
62
|
* Sticky a notification making it appear until explicitly closed
|
52
63
|
* Set notification priority
|
53
64
|
* Convenience methods such as notify_ok, notify_warning, notify_error, and notify_info
|
54
|
-
* Etc (consult growlnotify --help)
|
65
|
+
* Etc (consult growlnotify --help)
|
66
|
+
|
67
|
+
== Installing growlnotify
|
68
|
+
|
69
|
+
Visit http://growl.info/documentation.php for installation help.
|
70
|
+
|
71
|
+
== Known Issues
|
72
|
+
|
73
|
+
It seems that growlnotify will essentially ignore or block excessive usage
|
74
|
+
of the notifications at random. To prevent this you may need to do something like
|
75
|
+
below if you are calling many in sequence:
|
76
|
+
|
77
|
+
notify 'Something'; sleep 0.2
|
78
|
+
notify_ok 'Updated'; sleep 0.2
|
79
|
+
notify_info 'You have new mail'; sleep 0.2
|
80
|
+
notify_warning 'Merged required'; sleep 0.2
|
81
|
+
notify_error 'Oh Noes!'; sleep 0.2
|
82
|
+
|
83
|
+
== Contribute
|
84
|
+
|
85
|
+
Fork / send a pull request or submit a ticket at:
|
86
|
+
http://github.com/visionmedia/growl/issues
|
55
87
|
|
56
88
|
== License:
|
57
89
|
|
data/examples/growl.rb
CHANGED
@@ -7,24 +7,13 @@ puts "growlnotify version #{Growl.version} installed"
|
|
7
7
|
imagepath = File.dirname(__FILE__) + '/../spec/fixtures/image.png'
|
8
8
|
iconpath = File.dirname(__FILE__) + '/../spec/fixtures/icon.icns'
|
9
9
|
|
10
|
-
Growl.notify do |notification|
|
11
|
-
notification.sticky!
|
12
|
-
notification.title = 'Sticky'
|
13
|
-
notification.message = 'Im sticky'
|
14
|
-
end
|
15
|
-
|
16
|
-
Growl.notify do
|
17
|
-
sticky!
|
18
|
-
self.title = 'Image'
|
19
|
-
self.message = 'I have an image as an icon'
|
20
|
-
self.image = imagepath
|
21
|
-
end
|
22
|
-
|
23
10
|
include Growl
|
24
11
|
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
12
|
+
notify_info 'New email received', :sticky => true, :title => 'Some app'; sleep 0.2
|
13
|
+
notify_ok 'Deployment complete' ; sleep 0.2
|
14
|
+
notify_error 'Deployment failure' ; sleep 0.2
|
15
|
+
notify 'Safari icon', :icon => :Safari ; sleep 0.2
|
16
|
+
notify 'Jpeg icon', :icon => :jpeg ; sleep 0.2
|
17
|
+
notify 'Image icon', :icon => imagepath ; sleep 0.2
|
18
|
+
notify 'Icns icon', :icon => iconpath ; sleep 0.2
|
19
|
+
notify 'Path extname icon', :icon => 'foo.rb' ; sleep 0.2
|
@@ -2,15 +2,15 @@
|
|
2
2
|
|
3
3
|
Gem::Specification.new do |s|
|
4
4
|
s.name = %q{growl}
|
5
|
-
s.version = "
|
5
|
+
s.version = "1.0.2"
|
6
6
|
|
7
7
|
s.required_rubygems_version = Gem::Requirement.new(">= 1.2") if s.respond_to? :required_rubygems_version=
|
8
8
|
s.authors = ["TJ Holowaychuk"]
|
9
|
-
s.date = %q{2009-04-
|
9
|
+
s.date = %q{2009-04-19}
|
10
10
|
s.description = %q{growlnotify bindings}
|
11
11
|
s.email = %q{tj@vision-media.ca}
|
12
12
|
s.extra_rdoc_files = ["lib/growl/growl.rb", "lib/growl/images/error.png", "lib/growl/images/info.png", "lib/growl/images/ok.png", "lib/growl/images/warning.png", "lib/growl/version.rb", "lib/growl.rb", "README.rdoc", "tasks/docs.rake", "tasks/gemspec.rake", "tasks/spec.rake"]
|
13
|
-
s.files = ["examples/growl.rb", "
|
13
|
+
s.files = ["examples/growl.rb", "growl.gemspec", "History.rdoc", "lib/growl/growl.rb", "lib/growl/images/error.png", "lib/growl/images/info.png", "lib/growl/images/ok.png", "lib/growl/images/warning.png", "lib/growl/version.rb", "lib/growl.rb", "Manifest", "Rakefile", "README.rdoc", "spec/fixtures/icon.icns", "spec/fixtures/image.png", "spec/growl_spec.rb", "spec/spec_helper.rb", "tasks/docs.rake", "tasks/gemspec.rake", "tasks/spec.rake"]
|
14
14
|
s.has_rdoc = true
|
15
15
|
s.homepage = %q{http://github.com/visionmedia/growl}
|
16
16
|
s.rdoc_options = ["--line-numbers", "--inline-source", "--title", "Growl", "--main", "README.rdoc"]
|
data/lib/growl/growl.rb
CHANGED
@@ -30,6 +30,7 @@ module Growl
|
|
30
30
|
def notify message = nil, options = {}, &block
|
31
31
|
return unless Growl.installed?
|
32
32
|
options.merge! :message => message if message
|
33
|
+
Growl.normalize_icon! options
|
33
34
|
Growl.new(options, &block).run
|
34
35
|
end
|
35
36
|
module_function :notify
|
@@ -76,6 +77,37 @@ module Growl
|
|
76
77
|
Base.new *args, &block
|
77
78
|
end
|
78
79
|
|
80
|
+
##
|
81
|
+
# Normalize the icon option in +options+. This performs
|
82
|
+
# the following operations in order to allow for the :icon
|
83
|
+
# key to work with a variety of values:
|
84
|
+
#
|
85
|
+
# * path to an icon sets :iconpath
|
86
|
+
# * path to an image sets :image
|
87
|
+
# * capitalized word sets :appIcon
|
88
|
+
# * filename uses extname as :icon
|
89
|
+
# * otherwise treated as :icon
|
90
|
+
|
91
|
+
def self.normalize_icon! options = {}
|
92
|
+
return unless options.include? :icon
|
93
|
+
icon = options.delete(:icon).to_s
|
94
|
+
if File.exists? icon
|
95
|
+
if File.extname(icon) == '.icns'
|
96
|
+
options[:iconpath] = icon
|
97
|
+
else
|
98
|
+
options[:image] = icon
|
99
|
+
end
|
100
|
+
else
|
101
|
+
if icon.capitalize == icon
|
102
|
+
options[:appIcon] = icon
|
103
|
+
elsif !(ext = File.extname(icon)).empty?
|
104
|
+
options[:icon] = ext[1..-1]
|
105
|
+
else
|
106
|
+
options[:icon] = icon
|
107
|
+
end
|
108
|
+
end
|
109
|
+
end
|
110
|
+
|
79
111
|
#--
|
80
112
|
# Growl base
|
81
113
|
#++
|
@@ -123,9 +155,9 @@ module Growl
|
|
123
155
|
#
|
124
156
|
# switch :sticky
|
125
157
|
#
|
126
|
-
# @growl.sticky!
|
158
|
+
# @growl.sticky! # => true
|
127
159
|
# @growl.sticky? # => true
|
128
|
-
# @growl.sticky = false
|
160
|
+
# @growl.sticky = false # => false
|
129
161
|
# @growl.sticky? # => false
|
130
162
|
#
|
131
163
|
|
data/lib/growl/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: visionmedia-growl
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 1.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- TJ Holowaychuk
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2009-04-
|
12
|
+
date: 2009-04-19 00:00:00 -07:00
|
13
13
|
default_executable:
|
14
14
|
dependencies: []
|
15
15
|
|
@@ -33,7 +33,7 @@ extra_rdoc_files:
|
|
33
33
|
- tasks/spec.rake
|
34
34
|
files:
|
35
35
|
- examples/growl.rb
|
36
|
-
-
|
36
|
+
- growl.gemspec
|
37
37
|
- History.rdoc
|
38
38
|
- lib/growl/growl.rb
|
39
39
|
- lib/growl/images/error.png
|
@@ -52,8 +52,6 @@ files:
|
|
52
52
|
- tasks/docs.rake
|
53
53
|
- tasks/gemspec.rake
|
54
54
|
- tasks/spec.rake
|
55
|
-
- Todo.rdoc
|
56
|
-
- growl.gemspec
|
57
55
|
has_rdoc: true
|
58
56
|
homepage: http://github.com/visionmedia/growl
|
59
57
|
post_install_message:
|
data/Todo.rdoc
DELETED
@@ -1,15 +0,0 @@
|
|
1
|
-
|
2
|
-
== Major:
|
3
|
-
|
4
|
-
* Fix priority, and have constants
|
5
|
-
* Switch aliases since appIcon is ... lame
|
6
|
-
* Allow the icon switch to be an image, icon, or extension. This would be much more usable than --icon, --image, and --iconpath
|
7
|
-
* Docs for installing growlnotify
|
8
|
-
|
9
|
-
== Minor:
|
10
|
-
|
11
|
-
* Nothing
|
12
|
-
|
13
|
-
== Brainstorming:
|
14
|
-
|
15
|
-
* Nothing
|