notifier 0.1.5 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- data/Gemfile.lock +1 -1
- data/lib/notifier.rb +2 -1
- data/lib/notifier/gntp.rb +22 -0
- data/lib/notifier/version.rb +2 -2
- data/test/notifier_test.rb +1 -1
- metadata +4 -3
data/Gemfile.lock
CHANGED
data/lib/notifier.rb
CHANGED
@@ -2,6 +2,7 @@ require "open3"
|
|
2
2
|
|
3
3
|
module Notifier
|
4
4
|
autoload :Growl, "notifier/growl"
|
5
|
+
autoload :GNTP, "notifier/gntp"
|
5
6
|
autoload :Snarl, "notifier/snarl"
|
6
7
|
autoload :OsdCat, "notifier/osd_cat"
|
7
8
|
autoload :Knotify, "notifier/knotify"
|
@@ -35,7 +36,7 @@ module Notifier
|
|
35
36
|
end
|
36
37
|
|
37
38
|
def from_name(name)
|
38
|
-
|
39
|
+
const_get(classify(name.to_s))
|
39
40
|
rescue Exception
|
40
41
|
nil
|
41
42
|
end
|
@@ -0,0 +1,22 @@
|
|
1
|
+
module Notifier
|
2
|
+
module GNTP
|
3
|
+
extend self
|
4
|
+
|
5
|
+
def supported?
|
6
|
+
begin
|
7
|
+
require "ruby_gntp" unless defined?(::GNTP)
|
8
|
+
true
|
9
|
+
rescue LoadError
|
10
|
+
false
|
11
|
+
end
|
12
|
+
end
|
13
|
+
|
14
|
+
def notify(options)
|
15
|
+
::GNTP.notify(
|
16
|
+
:title => options[:title],
|
17
|
+
:text => options[:message],
|
18
|
+
:icon => options[:image]
|
19
|
+
)
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
data/lib/notifier/version.rb
CHANGED
data/test/notifier_test.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: notifier
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -73,6 +73,7 @@ files:
|
|
73
73
|
- README.rdoc
|
74
74
|
- Rakefile
|
75
75
|
- lib/notifier.rb
|
76
|
+
- lib/notifier/gntp.rb
|
76
77
|
- lib/notifier/growl.rb
|
77
78
|
- lib/notifier/kdialog.rb
|
78
79
|
- lib/notifier/knotify.rb
|
@@ -99,7 +100,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
99
100
|
version: '0'
|
100
101
|
segments:
|
101
102
|
- 0
|
102
|
-
hash:
|
103
|
+
hash: 2300416509400274521
|
103
104
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
104
105
|
none: false
|
105
106
|
requirements:
|
@@ -108,7 +109,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
108
109
|
version: '0'
|
109
110
|
segments:
|
110
111
|
- 0
|
111
|
-
hash:
|
112
|
+
hash: 2300416509400274521
|
112
113
|
requirements:
|
113
114
|
- Growl, Libnotify, OSD, KDE (Knotify and Kdialog) or Snarl
|
114
115
|
rubyforge_project:
|