notifier 0.1.3 → 0.1.4
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/Gemfile +1 -3
- data/Gemfile.lock +3 -1
- data/README.rdoc +5 -0
- data/lib/notifier.rb +2 -0
- data/lib/notifier/growl.rb +9 -9
- data/lib/notifier/kdialog.rb +6 -6
- data/lib/notifier/knotify.rb +7 -3
- data/lib/notifier/notify_send.rb +8 -3
- data/lib/notifier/osd_cat.rb +18 -14
- data/lib/notifier/version.rb +1 -1
- data/notifier.gemspec +1 -0
- metadata +58 -47
data/Gemfile
CHANGED
data/Gemfile.lock
CHANGED
@@ -1,12 +1,13 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
notifier (0.1.
|
4
|
+
notifier (0.1.4)
|
5
5
|
|
6
6
|
GEM
|
7
7
|
remote: http://rubygems.org/
|
8
8
|
specs:
|
9
9
|
mocha (0.9.12)
|
10
|
+
rake (0.9.2.2)
|
10
11
|
test-unit (2.2.0)
|
11
12
|
|
12
13
|
PLATFORMS
|
@@ -15,4 +16,5 @@ PLATFORMS
|
|
15
16
|
DEPENDENCIES
|
16
17
|
mocha
|
17
18
|
notifier!
|
19
|
+
rake
|
18
20
|
test-unit
|
data/README.rdoc
CHANGED
data/lib/notifier.rb
CHANGED
data/lib/notifier/growl.rb
CHANGED
@@ -11,16 +11,16 @@ module Notifier
|
|
11
11
|
|
12
12
|
def notify(options)
|
13
13
|
register
|
14
|
-
command =
|
15
|
-
growlnotify
|
16
|
-
--name
|
17
|
-
--image
|
18
|
-
--priority
|
19
|
-
--message
|
20
|
-
|
21
|
-
]
|
14
|
+
command = [
|
15
|
+
"growlnotify",
|
16
|
+
"--name", "test_notifier",
|
17
|
+
"--image", options[:image],
|
18
|
+
"--priority", "2",
|
19
|
+
"--message", options[:message],
|
20
|
+
options[:title]
|
21
|
+
]
|
22
22
|
|
23
|
-
Thread.new {
|
23
|
+
Thread.new { system(*command) }
|
24
24
|
end
|
25
25
|
|
26
26
|
def register
|
data/lib/notifier/kdialog.rb
CHANGED
@@ -7,13 +7,13 @@ module Notifier
|
|
7
7
|
end
|
8
8
|
|
9
9
|
def notify(options)
|
10
|
-
command =
|
11
|
-
kdialog
|
12
|
-
--title
|
13
|
-
--passivepopup
|
14
|
-
]
|
10
|
+
command = [
|
11
|
+
"kdialog",
|
12
|
+
"--title", options[:title],
|
13
|
+
"--passivepopup", options[:message], "5"
|
14
|
+
]
|
15
15
|
|
16
|
-
Thread.new {
|
16
|
+
Thread.new { system(*command) }
|
17
17
|
end
|
18
18
|
end
|
19
19
|
end
|
data/lib/notifier/knotify.rb
CHANGED
@@ -7,9 +7,13 @@ module Notifier
|
|
7
7
|
end
|
8
8
|
|
9
9
|
def notify(options)
|
10
|
-
|
11
|
-
|
12
|
-
|
10
|
+
command = [
|
11
|
+
"dcop", "knotify", "default", "notify", "eventname",
|
12
|
+
options[:title], options[:message],
|
13
|
+
"", "", "16", "2"
|
14
|
+
]
|
15
|
+
|
16
|
+
Thread.new { system(*command) }
|
13
17
|
end
|
14
18
|
end
|
15
19
|
end
|
data/lib/notifier/notify_send.rb
CHANGED
@@ -7,9 +7,14 @@ module Notifier
|
|
7
7
|
end
|
8
8
|
|
9
9
|
def notify(options)
|
10
|
-
|
11
|
-
|
12
|
-
|
10
|
+
command = [
|
11
|
+
"notify-send", "-i",
|
12
|
+
options[:image],
|
13
|
+
options[:title],
|
14
|
+
options[:message]
|
15
|
+
]
|
16
|
+
|
17
|
+
Thread.new { system(*command) }
|
13
18
|
end
|
14
19
|
end
|
15
20
|
end
|
data/lib/notifier/osd_cat.rb
CHANGED
@@ -8,21 +8,25 @@ module Notifier
|
|
8
8
|
|
9
9
|
def notify(options)
|
10
10
|
color = options.fetch(:color, "white")
|
11
|
-
message = options[:message].inspect.gsub(/!/, "\\!")
|
12
|
-
command = %W[
|
13
|
-
echo #{message} |
|
14
|
-
osd_cat
|
15
|
-
--shadow=0
|
16
|
-
--colour=#{color}
|
17
|
-
--pos=top
|
18
|
-
--offset=10
|
19
|
-
--align=center
|
20
|
-
--font=-adobe-helvetica-bold-r-normal-*-*-240-*-*-p-*-*-*
|
21
|
-
--delay=5
|
22
|
-
--outline=4
|
23
|
-
].join(" ")
|
24
11
|
|
25
|
-
|
12
|
+
command = [
|
13
|
+
"osd_cat",
|
14
|
+
"--shadow", "0",
|
15
|
+
"--colour", color,
|
16
|
+
"--pos", "top",
|
17
|
+
"--offset", "10",
|
18
|
+
"--align", "center",
|
19
|
+
"--font", "-bitstream-bitstream charter-bold-r-*-*-*-350-*-*-*-*-*-*",
|
20
|
+
"--delay", "5",
|
21
|
+
"--outline", "4",
|
22
|
+
]
|
23
|
+
|
24
|
+
Thread.new do
|
25
|
+
Open3.popen3(*command) do |stdin, stdout, stderr|
|
26
|
+
stdin.puts options[:message]
|
27
|
+
stdin.close
|
28
|
+
end
|
29
|
+
end
|
26
30
|
end
|
27
31
|
end
|
28
32
|
end
|
data/lib/notifier/version.rb
CHANGED
data/notifier.gemspec
CHANGED
metadata
CHANGED
@@ -1,50 +1,57 @@
|
|
1
|
-
--- !ruby/object:Gem::Specification
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
2
|
name: notifier
|
3
|
-
version: !ruby/object:Gem::Version
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.1.4
|
4
5
|
prerelease:
|
5
|
-
version: 0.1.3
|
6
6
|
platform: ruby
|
7
|
-
authors:
|
7
|
+
authors:
|
8
8
|
- Nando Vieira
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
dependencies:
|
16
|
-
- !ruby/object:Gem::Dependency
|
12
|
+
date: 2011-10-06 00:00:00.000000000 Z
|
13
|
+
dependencies:
|
14
|
+
- !ruby/object:Gem::Dependency
|
17
15
|
name: test-unit
|
18
|
-
|
19
|
-
requirement: &id001 !ruby/object:Gem::Requirement
|
16
|
+
requirement: &70155414188400 !ruby/object:Gem::Requirement
|
20
17
|
none: false
|
21
|
-
requirements:
|
22
|
-
- -
|
23
|
-
- !ruby/object:Gem::Version
|
24
|
-
version:
|
18
|
+
requirements:
|
19
|
+
- - ! '>='
|
20
|
+
- !ruby/object:Gem::Version
|
21
|
+
version: '0'
|
25
22
|
type: :development
|
26
|
-
|
27
|
-
|
23
|
+
prerelease: false
|
24
|
+
version_requirements: *70155414188400
|
25
|
+
- !ruby/object:Gem::Dependency
|
28
26
|
name: mocha
|
27
|
+
requirement: &70155414187420 !ruby/object:Gem::Requirement
|
28
|
+
none: false
|
29
|
+
requirements:
|
30
|
+
- - ! '>='
|
31
|
+
- !ruby/object:Gem::Version
|
32
|
+
version: '0'
|
33
|
+
type: :development
|
29
34
|
prerelease: false
|
30
|
-
|
35
|
+
version_requirements: *70155414187420
|
36
|
+
- !ruby/object:Gem::Dependency
|
37
|
+
name: rake
|
38
|
+
requirement: &70155414186700 !ruby/object:Gem::Requirement
|
31
39
|
none: false
|
32
|
-
requirements:
|
33
|
-
- -
|
34
|
-
- !ruby/object:Gem::Version
|
35
|
-
version:
|
40
|
+
requirements:
|
41
|
+
- - ! '>='
|
42
|
+
- !ruby/object:Gem::Version
|
43
|
+
version: '0'
|
36
44
|
type: :development
|
37
|
-
|
38
|
-
|
39
|
-
|
45
|
+
prerelease: false
|
46
|
+
version_requirements: *70155414186700
|
47
|
+
description: Send system notifications on several platforms with a simple and unified
|
48
|
+
API. Currently supports Growl, Libnotify, OSD, KDE (Knotify and Kdialog) and Snarl
|
49
|
+
email:
|
40
50
|
- fnando.vieira@gmail.com
|
41
51
|
executables: []
|
42
|
-
|
43
52
|
extensions: []
|
44
|
-
|
45
53
|
extra_rdoc_files: []
|
46
|
-
|
47
|
-
files:
|
54
|
+
files:
|
48
55
|
- .gitignore
|
49
56
|
- Gemfile
|
50
57
|
- Gemfile.lock
|
@@ -63,34 +70,38 @@ files:
|
|
63
70
|
- resources/register-growl.scpt
|
64
71
|
- test/notifier_test.rb
|
65
72
|
- test/test_helper.rb
|
66
|
-
has_rdoc: true
|
67
73
|
homepage: http://rubygems.org/gems/notifier
|
68
74
|
licenses: []
|
69
|
-
|
70
75
|
post_install_message:
|
71
76
|
rdoc_options: []
|
72
|
-
|
73
|
-
require_paths:
|
77
|
+
require_paths:
|
74
78
|
- lib
|
75
|
-
required_ruby_version: !ruby/object:Gem::Requirement
|
79
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
76
80
|
none: false
|
77
|
-
requirements:
|
78
|
-
- -
|
79
|
-
- !ruby/object:Gem::Version
|
80
|
-
version:
|
81
|
-
|
81
|
+
requirements:
|
82
|
+
- - ! '>='
|
83
|
+
- !ruby/object:Gem::Version
|
84
|
+
version: '0'
|
85
|
+
segments:
|
86
|
+
- 0
|
87
|
+
hash: 226729221616814757
|
88
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
82
89
|
none: false
|
83
|
-
requirements:
|
84
|
-
- -
|
85
|
-
- !ruby/object:Gem::Version
|
86
|
-
version:
|
87
|
-
|
90
|
+
requirements:
|
91
|
+
- - ! '>='
|
92
|
+
- !ruby/object:Gem::Version
|
93
|
+
version: '0'
|
94
|
+
segments:
|
95
|
+
- 0
|
96
|
+
hash: 226729221616814757
|
97
|
+
requirements:
|
88
98
|
- Growl, Libnotify, OSD, KDE (Knotify and Kdialog) or Snarl
|
89
99
|
rubyforge_project:
|
90
|
-
rubygems_version: 1.
|
100
|
+
rubygems_version: 1.8.10
|
91
101
|
signing_key:
|
92
102
|
specification_version: 3
|
93
|
-
summary: Send system notifications on several platforms with a simple and unified
|
94
|
-
|
103
|
+
summary: Send system notifications on several platforms with a simple and unified
|
104
|
+
API. Currently supports Growl, Libnotify, OSD, KDE (Knotify and Kdialog) and Snarl
|
105
|
+
test_files:
|
95
106
|
- test/notifier_test.rb
|
96
107
|
- test/test_helper.rb
|