notifier 0.5.0 → 0.5.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: dd923128a3458ecd262b6bb21a948fa6a626ea43
4
- data.tar.gz: 2954f0a783b91705f4b389c670a09611808e1242
3
+ metadata.gz: ded78a65a591a7d25fc841c511ed827622fc1463
4
+ data.tar.gz: db832909bd190d77d8dcdd2248a60a4098e616db
5
5
  SHA512:
6
- metadata.gz: 71c15cf0499fb9e8896108ee4bba840313c142c79fc19ac0be6faee5fa0b4f38e47cd41f673eaa6e37e2600d75bd37539557eb974607696e7d991f149e4277e2
7
- data.tar.gz: 066b7ee6f3fa640f7909d03640a65a9f0f29119b60d137edf97b3641c145fe88ec5738fe1b5c2cc8e2f82e0cfb2f43d6aeeae61a6dd0bc0a556b78bdae1195c6
6
+ metadata.gz: 2e26970c850341800b43a6d61865f82b95db278ed0666e8a550848d51b479cf837dbceaeb950224f0c1cceda8830f5f4ba0e69b027f2bf624a444adf08436d54
7
+ data.tar.gz: 96e7619e015a14c3383ccedca1423ce638cbbc771ac5789d9f455901b1bbf34d63c5356c70d9a7ef43107fa46eaf80c19263812f3ac02d55af1289cd9dee1f80
data/.gitignore CHANGED
@@ -1,4 +1,5 @@
1
1
  pkg/*
2
2
  *.gem
3
3
  .bundle
4
- .DS_Store
4
+ .DS_Store
5
+ *.lock
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
 
@@ -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
@@ -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], "5"
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
@@ -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
@@ -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
@@ -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
@@ -2,7 +2,7 @@ module Notifier
2
2
  module Version
3
3
  MAJOR = 0
4
4
  MINOR = 5
5
- PATCH = 0
5
+ PATCH = 1
6
6
  STRING = "#{MAJOR}.#{MINOR}.#{PATCH}"
7
7
  end
8
8
  end
@@ -7,22 +7,22 @@ describe Notifier do
7
7
  end
8
8
 
9
9
  it "retrieves list of supported notifiers" do
10
- Notifier::Snarl.stub :supported? => true
11
- Notifier::Knotify.stub :supported? => true
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.stub :supported? => true
18
- Notifier::Knotify.stub :supported? => true
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.stub :supported? => true
25
- Notifier::Knotify.stub :supported? => true
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.stub :supported? => true
40
- Notifier::Snarl.should_receive(:notify).with(params)
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.stub :supported? => true
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.stub :supported? => false unless notifier == Notifier::Placebo
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.0
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: 2014-04-30 00:00:00.000000000 Z
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.2.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