notifier 0.5.0 → 0.5.1
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.
- checksums.yaml +4 -4
- data/.gitignore +2 -1
- data/README.rdoc +1 -1
- data/lib/notifier/growl.rb +4 -4
- data/lib/notifier/kdialog.rb +4 -3
- data/lib/notifier/knotify.rb +2 -2
- data/lib/notifier/notify_send.rb +4 -4
- data/lib/notifier/osd_cat.rb +2 -2
- data/lib/notifier/terminal_notifier.rb +4 -4
- data/lib/notifier/version.rb +1 -1
- data/spec/notifier_spec.rb +9 -9
- data/spec/spec_helper.rb +1 -1
- metadata +3 -4
- data/Gemfile.lock +0 -26
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ded78a65a591a7d25fc841c511ed827622fc1463
|
4
|
+
data.tar.gz: db832909bd190d77d8dcdd2248a60a4098e616db
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2e26970c850341800b43a6d61865f82b95db278ed0666e8a550848d51b479cf837dbceaeb950224f0c1cceda8830f5f4ba0e69b027f2bf624a444adf08436d54
|
7
|
+
data.tar.gz: 96e7619e015a14c3383ccedca1423ce638cbbc771ac5789d9f455901b1bbf34d63c5356c70d9a7ef43107fa46eaf80c19263812f3ac02d55af1289cd9dee1f80
|
data/.gitignore
CHANGED
data/README.rdoc
CHANGED
@@ -56,7 +56,7 @@ If your system support more than one notifier, you can specify which one you pre
|
|
56
56
|
|
57
57
|
Notifier.default_notifier = :notify_send
|
58
58
|
|
59
|
-
The available names are <tt>growl</tt>, <tt>kdialog</tt>, <tt>knotify</tt>, <tt>notify_send</tt>, <tt>osd_cat</tt>, and <tt>snarl</tt>.
|
59
|
+
The available names are <tt>growl</tt>, <tt>terminal_notifier</tt>, <tt>kdialog</tt>, <tt>knotify</tt>, <tt>notify_send</tt>, <tt>osd_cat</tt>, and <tt>snarl</tt>.
|
60
60
|
|
61
61
|
There are several helper methods that you can use in order to retrieve notifiers.
|
62
62
|
|
data/lib/notifier/growl.rb
CHANGED
@@ -14,13 +14,13 @@ module Notifier
|
|
14
14
|
command = [
|
15
15
|
"growlnotify",
|
16
16
|
"--name", "test_notifier",
|
17
|
-
"--image", options.fetch(:image, ''),
|
17
|
+
"--image", options.fetch(:image, '').to_s,
|
18
18
|
"--priority", "2",
|
19
|
-
"--message", options[:message],
|
20
|
-
options[:title]
|
19
|
+
"--message", options[:message].to_s,
|
20
|
+
options[:title].to_s
|
21
21
|
]
|
22
22
|
|
23
|
-
Thread.new { system(*command) }
|
23
|
+
Thread.new { system(*command) }.join
|
24
24
|
end
|
25
25
|
|
26
26
|
def register
|
data/lib/notifier/kdialog.rb
CHANGED
@@ -9,11 +9,12 @@ module Notifier
|
|
9
9
|
def notify(options)
|
10
10
|
command = [
|
11
11
|
"kdialog",
|
12
|
-
"--title", options[:title],
|
13
|
-
"--passivepopup", options[:message],
|
12
|
+
"--title", options[:title].to_s,
|
13
|
+
"--passivepopup", options[:message].to_s,
|
14
|
+
"5"
|
14
15
|
]
|
15
16
|
|
16
|
-
Thread.new { system(*command) }
|
17
|
+
Thread.new { system(*command) }.join
|
17
18
|
end
|
18
19
|
end
|
19
20
|
end
|
data/lib/notifier/knotify.rb
CHANGED
@@ -9,11 +9,11 @@ module Notifier
|
|
9
9
|
def notify(options)
|
10
10
|
command = [
|
11
11
|
"dcop", "knotify", "default", "notify", "eventname",
|
12
|
-
options[:title], options[:message],
|
12
|
+
options[:title].to_s, options[:message].to_s,
|
13
13
|
"", "", "16", "2"
|
14
14
|
]
|
15
15
|
|
16
|
-
Thread.new { system(*command) }
|
16
|
+
Thread.new { system(*command) }.join
|
17
17
|
end
|
18
18
|
end
|
19
19
|
end
|
data/lib/notifier/notify_send.rb
CHANGED
@@ -9,12 +9,12 @@ module Notifier
|
|
9
9
|
def notify(options)
|
10
10
|
command = [
|
11
11
|
"notify-send", "-i",
|
12
|
-
options[:image],
|
13
|
-
options[:title],
|
14
|
-
options[:message]
|
12
|
+
options[:image].to_s,
|
13
|
+
options[:title].to_s,
|
14
|
+
options[:message].to_s
|
15
15
|
]
|
16
16
|
|
17
|
-
Thread.new { system(*command) }
|
17
|
+
Thread.new { system(*command) }.join
|
18
18
|
end
|
19
19
|
end
|
20
20
|
end
|
data/lib/notifier/osd_cat.rb
CHANGED
@@ -7,7 +7,7 @@ module Notifier
|
|
7
7
|
end
|
8
8
|
|
9
9
|
def notify(options)
|
10
|
-
color = options.fetch(:color, "white")
|
10
|
+
color = options.fetch(:color, "white").to_s
|
11
11
|
|
12
12
|
command = [
|
13
13
|
"osd_cat",
|
@@ -26,7 +26,7 @@ module Notifier
|
|
26
26
|
stdin.puts options[:message]
|
27
27
|
stdin.close
|
28
28
|
end
|
29
|
-
end
|
29
|
+
end.join
|
30
30
|
end
|
31
31
|
end
|
32
32
|
end
|
@@ -10,12 +10,12 @@ module Notifier
|
|
10
10
|
command = [
|
11
11
|
"terminal-notifier",
|
12
12
|
"-group", "notifier-rubygems",
|
13
|
-
"-title", options[:title],
|
14
|
-
"-appIcon", options.fetch(:image, ""),
|
15
|
-
"-message", options[:message]
|
13
|
+
"-title", options[:title].to_s,
|
14
|
+
"-appIcon", options.fetch(:image, "").to_s,
|
15
|
+
"-message", options[:message].to_s
|
16
16
|
]
|
17
17
|
|
18
|
-
Thread.new { system(*command) }
|
18
|
+
Thread.new { system(*command) }.join
|
19
19
|
end
|
20
20
|
end
|
21
21
|
end
|
data/lib/notifier/version.rb
CHANGED
data/spec/notifier_spec.rb
CHANGED
@@ -7,22 +7,22 @@ describe Notifier do
|
|
7
7
|
end
|
8
8
|
|
9
9
|
it "retrieves list of supported notifiers" do
|
10
|
-
Notifier::Snarl.
|
11
|
-
Notifier::Knotify.
|
10
|
+
allow(Notifier::Snarl).to receive_messages :supported? => true
|
11
|
+
allow(Notifier::Knotify).to receive_messages :supported? => true
|
12
12
|
|
13
13
|
expect(Notifier.supported_notifiers.size).to eql(3)
|
14
14
|
end
|
15
15
|
|
16
16
|
it "returns first available notifier" do
|
17
|
-
Notifier::Snarl.
|
18
|
-
Notifier::Knotify.
|
17
|
+
allow(Notifier::Snarl).to receive_messages :supported? => true
|
18
|
+
allow(Notifier::Knotify).to receive_messages :supported? => true
|
19
19
|
|
20
20
|
expect(Notifier.notifier).to eql(Notifier::Snarl)
|
21
21
|
end
|
22
22
|
|
23
23
|
it "prefers default notifier" do
|
24
|
-
Notifier::Snarl.
|
25
|
-
Notifier::Knotify.
|
24
|
+
allow(Notifier::Snarl).to receive_messages :supported? => true
|
25
|
+
allow(Notifier::Knotify).to receive_messages :supported? => true
|
26
26
|
|
27
27
|
Notifier.default_notifier = :knotify
|
28
28
|
|
@@ -36,8 +36,8 @@ describe Notifier do
|
|
36
36
|
:image => "image.png"
|
37
37
|
}
|
38
38
|
|
39
|
-
Notifier::Snarl.
|
40
|
-
Notifier::Snarl.
|
39
|
+
allow(Notifier::Snarl).to receive_messages :supported? => true
|
40
|
+
expect(Notifier::Snarl).to receive(:notify).with(params)
|
41
41
|
|
42
42
|
Notifier.notify(params)
|
43
43
|
end
|
@@ -57,7 +57,7 @@ describe Notifier do
|
|
57
57
|
end
|
58
58
|
|
59
59
|
it "returns notifier by its name when supported" do
|
60
|
-
Notifier::Snarl.
|
60
|
+
allow(Notifier::Snarl).to receive_messages :supported? => true
|
61
61
|
expect(Notifier.supported_notifier_from_name(:snarl)).to eql(Notifier::Snarl)
|
62
62
|
end
|
63
63
|
|
data/spec/spec_helper.rb
CHANGED
@@ -3,7 +3,7 @@ require "notifier"
|
|
3
3
|
module SpecHelpers
|
4
4
|
def unsupport_all_notifiers
|
5
5
|
Notifier.notifiers.each do |notifier|
|
6
|
-
notifier.
|
6
|
+
allow(notifier).to receive_messages(:supported? => false) unless notifier == Notifier::Placebo
|
7
7
|
end
|
8
8
|
end
|
9
9
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: notifier
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.5.
|
4
|
+
version: 0.5.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Nando Vieira
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2015-03-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rspec
|
@@ -49,7 +49,6 @@ files:
|
|
49
49
|
- ".gitignore"
|
50
50
|
- ".rspec"
|
51
51
|
- Gemfile
|
52
|
-
- Gemfile.lock
|
53
52
|
- README.rdoc
|
54
53
|
- Rakefile
|
55
54
|
- lib/notifier.rb
|
@@ -89,7 +88,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
89
88
|
requirements:
|
90
89
|
- Growl, terminal-notifier, Libnotify, OSD, KDE (Knotify and Kdialog) or Snarl
|
91
90
|
rubyforge_project:
|
92
|
-
rubygems_version: 2.
|
91
|
+
rubygems_version: 2.4.6
|
93
92
|
signing_key:
|
94
93
|
specification_version: 4
|
95
94
|
summary: Send system notifications on several platforms with a simple and unified
|
data/Gemfile.lock
DELETED
@@ -1,26 +0,0 @@
|
|
1
|
-
PATH
|
2
|
-
remote: .
|
3
|
-
specs:
|
4
|
-
notifier (0.5.0)
|
5
|
-
|
6
|
-
GEM
|
7
|
-
remote: http://rubygems.org/
|
8
|
-
specs:
|
9
|
-
diff-lcs (1.2.5)
|
10
|
-
rake (10.3.1)
|
11
|
-
rspec (2.14.1)
|
12
|
-
rspec-core (~> 2.14.0)
|
13
|
-
rspec-expectations (~> 2.14.0)
|
14
|
-
rspec-mocks (~> 2.14.0)
|
15
|
-
rspec-core (2.14.8)
|
16
|
-
rspec-expectations (2.14.5)
|
17
|
-
diff-lcs (>= 1.1.3, < 2.0)
|
18
|
-
rspec-mocks (2.14.6)
|
19
|
-
|
20
|
-
PLATFORMS
|
21
|
-
ruby
|
22
|
-
|
23
|
-
DEPENDENCIES
|
24
|
-
notifier!
|
25
|
-
rake
|
26
|
-
rspec
|