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 CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- notifier (0.1.5)
4
+ notifier (0.2.0)
5
5
 
6
6
  GEM
7
7
  remote: http://rubygems.org/
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
- notifier = const_get(classify(name.to_s))
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
@@ -1,8 +1,8 @@
1
1
  module Notifier
2
2
  module Version
3
3
  MAJOR = 0
4
- MINOR = 1
5
- PATCH = 5
4
+ MINOR = 2
5
+ PATCH = 0
6
6
  STRING = "#{MAJOR}.#{MINOR}.#{PATCH}"
7
7
  end
8
8
  end
@@ -43,7 +43,7 @@ class NotifierTest < Test::Unit::TestCase
43
43
  end
44
44
 
45
45
  test "retrieve list of all notifiers" do
46
- assert_equal 7, Notifier.notifiers.size
46
+ assert_equal 8, Notifier.notifiers.size
47
47
  end
48
48
 
49
49
  test "consider Placebo as fallback notifier" do
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.1.5
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: 787796298279897038
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: 787796298279897038
112
+ hash: 2300416509400274521
112
113
  requirements:
113
114
  - Growl, Libnotify, OSD, KDE (Knotify and Kdialog) or Snarl
114
115
  rubyforge_project: