notifier 0.1.1 → 0.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/lib/notifier.rb +2 -1
- data/lib/notifier/growl.rb +9 -3
- data/lib/notifier/kdialog.rb +7 -3
- data/lib/notifier/version.rb +1 -1
- metadata +3 -3
data/lib/notifier.rb
CHANGED
@@ -6,6 +6,7 @@ module Notifier
|
|
6
6
|
autoload :Kdialog, "notifier/kdialog"
|
7
7
|
autoload :NotifySend, "notifier/notify_send"
|
8
8
|
autoload :Placebo, "notifier/placebo"
|
9
|
+
autoload :Version, "notifier/version"
|
9
10
|
|
10
11
|
extend self
|
11
12
|
|
@@ -23,7 +24,7 @@ module Notifier
|
|
23
24
|
|
24
25
|
def notifiers
|
25
26
|
constants.collect do |name|
|
26
|
-
const_get(name) unless name.to_s
|
27
|
+
const_get(name) unless %w[Placebo Version].include?(name.to_s)
|
27
28
|
end.compact + [Placebo]
|
28
29
|
end
|
29
30
|
|
data/lib/notifier/growl.rb
CHANGED
@@ -11,10 +11,16 @@ module Notifier
|
|
11
11
|
|
12
12
|
def notify(options)
|
13
13
|
register
|
14
|
+
command = %W[
|
15
|
+
growlnotify
|
16
|
+
--name=test_notifier
|
17
|
+
--image='#{options[:image]}'
|
18
|
+
--priority=2
|
19
|
+
--message='#{options[:message]}'
|
20
|
+
'#{options[:title]}'
|
21
|
+
].join(" ")
|
14
22
|
|
15
|
-
Thread.new
|
16
|
-
`growlnotify -n test_notifier --image #{options[:image]} -p 2 -m '#{options[:message]}' -t '#{options[:title]}'`
|
17
|
-
end
|
23
|
+
Thread.new { `#{command}` }
|
18
24
|
end
|
19
25
|
|
20
26
|
def register
|
data/lib/notifier/kdialog.rb
CHANGED
@@ -7,9 +7,13 @@ module Notifier
|
|
7
7
|
end
|
8
8
|
|
9
9
|
def notify(options)
|
10
|
-
|
11
|
-
|
12
|
-
|
10
|
+
command = %W[
|
11
|
+
kdialog
|
12
|
+
--title='#{options[:title]}'
|
13
|
+
--passivepopup='#{options[:message]}' 5
|
14
|
+
].join(" ")
|
15
|
+
|
16
|
+
Thread.new { `#{command}` }
|
13
17
|
end
|
14
18
|
end
|
15
19
|
end
|
data/lib/notifier/version.rb
CHANGED
metadata
CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
|
|
5
5
|
segments:
|
6
6
|
- 0
|
7
7
|
- 1
|
8
|
-
-
|
9
|
-
version: 0.1.
|
8
|
+
- 2
|
9
|
+
version: 0.1.2
|
10
10
|
platform: ruby
|
11
11
|
authors:
|
12
12
|
- Nando Vieira
|
@@ -14,7 +14,7 @@ autorequire:
|
|
14
14
|
bindir: bin
|
15
15
|
cert_chain: []
|
16
16
|
|
17
|
-
date: 2010-
|
17
|
+
date: 2010-12-26 00:00:00 -02:00
|
18
18
|
default_executable:
|
19
19
|
dependencies:
|
20
20
|
- !ruby/object:Gem::Dependency
|