libnotify 0.9.0 → 0.9.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: cb813d3d2936bb55cb12711456685b480016bfd1
4
- data.tar.gz: 18ad99e58546d9a2c175f64d80f995b082d3d618
3
+ metadata.gz: b3e3e4e7c3c50e0b25b2a18ef60c7717c5951ba4
4
+ data.tar.gz: afb26d5ac4c8c274572ad74921814eee9bec7166
5
5
  SHA512:
6
- metadata.gz: cc495ae64b4864152f44f6ca1a022a6832db9ab9f49876e67fd7e27b7d60d44743e6518e043791135169646921e06dd1a81de7ef66e420c74e268b1182bb25c9
7
- data.tar.gz: 6d7c9f9a9835f7619c7a6413b72f1182d236d16783c12c9d824af2868f7cd81906f3da927387cb94a6d7ec3e701f84c1ffb44158bbdfba0cbdbee9d214458cbd
6
+ metadata.gz: c8be59a6a02be0c04606759b2f7351e06b441d269c3d17497f1f618bd9cdbf25a34a11a7ba2fc0e9041823e8c55a7bdb70c2b18dadb5c393dc990ccff5085d58
7
+ data.tar.gz: a744d8483391893c1f3fd30300bdd391953993eb5a5ea2e528d6acd91858edb2b5700c0a75321c2411a3e2f3df65762a2f70ab12821e74952da76d64aa540532
@@ -43,6 +43,7 @@ module Libnotify
43
43
  # end
44
44
  #
45
45
  # @param [Hash] options options creating a notification
46
+ # @option options [String] :app_name ('Libnotify::API') name of the application
46
47
  # @option options [String] :summary (' ') summary/title of the notification
47
48
  # @option options [String] :body (' ') the body
48
49
  # @option options [Fixnum, Float, nil, FalseClass, String] :timeout (nil) display duration of the notification.
@@ -9,7 +9,7 @@ module Libnotify
9
9
  include FFI
10
10
 
11
11
  attr_reader :timeout, :icon_path
12
- attr_accessor :summary, :body, :urgency, :append, :transient
12
+ attr_accessor :app_name, :summary, :body, :urgency, :append, :transient
13
13
 
14
14
  class << self
15
15
  # List of globs to icons
@@ -36,6 +36,7 @@ module Libnotify
36
36
  private :apply_options
37
37
 
38
38
  def set_defaults
39
+ self.app_name = self.class.to_s
39
40
  self.summary = self.body = ' '
40
41
  self.urgency = :normal
41
42
  self.timeout = nil
@@ -48,7 +49,7 @@ module Libnotify
48
49
  #
49
50
  # @see Libnotify.show
50
51
  def show!
51
- notify_init(self.class.to_s) or raise "notify_init failed"
52
+ notify_init(app_name) or raise "notify_init failed"
52
53
  @notification = notify_notification_new(summary, body, icon_path, nil)
53
54
  show
54
55
  end
@@ -1,3 +1,3 @@
1
1
  module Libnotify
2
- VERSION = "0.9.0"
2
+ VERSION = "0.9.1"
3
3
  end
@@ -5,6 +5,7 @@ class IntegrationTest < LibnotifyTestCase
5
5
  libnotify = Libnotify::API.new(:timeout => 0.5, :icon_path => :"emblem-favorite", :append => true)
6
6
 
7
7
  [ :low, :normal, :critical ].each do |urgency|
8
+ libnotify.app_name = "test"
8
9
  libnotify.summary = "#{RUBY_VERSION} at #{RUBY_PLATFORM}"
9
10
  libnotify.body = [ urgency, defined?(RUBY_DESCRIPTION) ? RUBY_DESCRIPTION : '?' ].join(" ")
10
11
  libnotify.urgency = urgency
@@ -2,23 +2,26 @@ require 'helper'
2
2
 
3
3
  class LibnotifyAPITest < LibnotifyTestCase
4
4
  test "instance default values" do
5
- assert_equal " ", libnotify.summary
6
- assert_equal " ", libnotify.body
7
- assert_equal :normal, libnotify.urgency
8
- assert_nil libnotify.timeout
9
- assert_nil libnotify.icon_path
10
- assert libnotify.append
11
- refute libnotify.transient
5
+ assert_equal "Libnotify::API", libnotify.app_name
6
+ assert_equal " ", libnotify.summary
7
+ assert_equal " ", libnotify.body
8
+ assert_equal :normal, libnotify.urgency
9
+ assert_nil libnotify.timeout
10
+ assert_nil libnotify.icon_path
11
+ assert libnotify.append
12
+ refute libnotify.transient
12
13
  end
13
14
 
14
15
  test "instance with options and block" do
15
16
  libnotify(:summary => "hello", :body => "body", :invalid_option => 23) do |n|
17
+ n.app_name = "foo"
16
18
  n.body = "overwritten"
17
19
  n.icon_path = "/path/to/icon"
18
20
  n.append = false
19
21
  n.transient = true
20
22
  end
21
23
 
24
+ assert_equal "foo", libnotify.app_name
22
25
  assert_equal "hello", libnotify.summary
23
26
  assert_equal "overwritten", libnotify.body
24
27
  assert_equal "/path/to/icon", libnotify.icon_path
metadata CHANGED
@@ -1,86 +1,86 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: libnotify
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.0
4
+ version: 0.9.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Peter Suschlik
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-12-17 00:00:00.000000000 Z
11
+ date: 2014-12-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: ffi
15
- version_requirements: !ruby/object:Gem::Requirement
15
+ requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
17
  - - ">="
18
18
  - !ruby/object:Gem::Version
19
19
  version: 1.0.11
20
- requirement: !ruby/object:Gem::Requirement
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
21
23
  requirements:
22
24
  - - ">="
23
25
  - !ruby/object:Gem::Version
24
26
  version: 1.0.11
25
- prerelease: false
26
- type: :runtime
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: yard
29
- version_requirements: !ruby/object:Gem::Requirement
29
+ requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
31
  - - "~>"
32
32
  - !ruby/object:Gem::Version
33
33
  version: 0.8.6.1
34
- requirement: !ruby/object:Gem::Requirement
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
35
37
  requirements:
36
38
  - - "~>"
37
39
  - !ruby/object:Gem::Version
38
40
  version: 0.8.6.1
39
- prerelease: false
40
- type: :development
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: minitest
43
- version_requirements: !ruby/object:Gem::Requirement
43
+ requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
45
  - - "~>"
46
46
  - !ruby/object:Gem::Version
47
47
  version: 4.7.4
48
- requirement: !ruby/object:Gem::Requirement
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
49
51
  requirements:
50
52
  - - "~>"
51
53
  - !ruby/object:Gem::Version
52
54
  version: 4.7.4
53
- prerelease: false
54
- type: :development
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: minitest-libnotify
57
- version_requirements: !ruby/object:Gem::Requirement
57
+ requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
59
  - - "~>"
60
60
  - !ruby/object:Gem::Version
61
61
  version: 0.2.2
62
- requirement: !ruby/object:Gem::Requirement
62
+ type: :development
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
63
65
  requirements:
64
66
  - - "~>"
65
67
  - !ruby/object:Gem::Version
66
68
  version: 0.2.2
67
- prerelease: false
68
- type: :development
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: simplecov
71
- version_requirements: !ruby/object:Gem::Requirement
71
+ requirement: !ruby/object:Gem::Requirement
72
72
  requirements:
73
73
  - - ">="
74
74
  - !ruby/object:Gem::Version
75
75
  version: '0'
76
- requirement: !ruby/object:Gem::Requirement
76
+ type: :development
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
77
79
  requirements:
78
80
  - - ">="
79
81
  - !ruby/object:Gem::Version
80
82
  version: '0'
81
- prerelease: false
82
- type: :development
83
- description:
83
+ description:
84
84
  email:
85
85
  - peter-libnotify@suschlik.de
86
86
  executables: []
@@ -121,7 +121,7 @@ homepage: http://rubygems.org/gems/libnotify
121
121
  licenses:
122
122
  - MIT
123
123
  metadata: {}
124
- post_install_message:
124
+ post_install_message:
125
125
  rdoc_options: []
126
126
  require_paths:
127
127
  - lib
@@ -136,10 +136,10 @@ required_rubygems_version: !ruby/object:Gem::Requirement
136
136
  - !ruby/object:Gem::Version
137
137
  version: '0'
138
138
  requirements: []
139
- rubyforge_project:
140
- rubygems_version: 2.4.4
141
- signing_key:
139
+ rubyforge_project:
140
+ rubygems_version: 2.4.5
141
+ signing_key:
142
142
  specification_version: 4
143
143
  summary: Ruby bindings for libnotify using FFI
144
144
  test_files: []
145
- has_rdoc:
145
+ has_rdoc: