uniform_notifier 1.12.1 → 1.13.0

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: 2277163be0ebc305f1d6b19d7fa21cfcd001495f
4
- data.tar.gz: 936dd7c4dca648ed7455e31fee864300c5b451c5
2
+ SHA256:
3
+ metadata.gz: b15645518b1a79ae7ce91a35ce7862a8436546f163c5ff7ccfee26cfac40cff2
4
+ data.tar.gz: 98518cb993748a7b0a24bb300e6753eb17c64941bf0f7234c170536179306d4d
5
5
  SHA512:
6
- metadata.gz: aed28aa21ea0317abeb16cdd224b07a59e2d236324de028eea148184e6fa2225885c39816a84a61be3b0245e4be1d8db464599fe8203d253ff36dbd820c591c7
7
- data.tar.gz: d9356571f31ccbc28ab7fd7fef5f27e7e7dc2783faf6cbb1888cc7e3ce9e20d60dfe212324d429a9119c6143cd1752a40b82b325fc37788f1bdf50890040b527
6
+ metadata.gz: 9f7783596886f335744b1a15ccb854d968a916491df2693a9076a2a67a63cc754357deea3d010c2773544dafe31a68495d5403096a8d75c906784425d60e45fe
7
+ data.tar.gz: f5376ec13ee6a0c5c4b2fc03cd3222f04608e015e443ed437d812305ef781d57db150cacfeefa03d5c3f85df477ec6cfeac9a511ccbe1df9f264af4be2a102aa
@@ -1,6 +1,11 @@
1
1
  # Next Release
2
2
 
3
- ## 1.12.1
3
+ ## 1.13.0 (10/05/2019)
4
+
5
+ * Add Honeybadger class dependecy injection.
6
+ * Allow configuration of Rollbar level.
7
+
8
+ ## 1.12.1 (10/30/2018)
4
9
 
5
10
  * Require Ruby 2.3+
6
11
 
data/README.md CHANGED
@@ -93,6 +93,8 @@ UniformNotifier.honeybadger = { :error_class => 'Exception' }
93
93
 
94
94
  # rollbar
95
95
  UniformNotifier.rollbar = true
96
+ # rollbar with options (level can be 'debug', 'info', 'warning', 'error' or 'critical')
97
+ UniformNotifier.rollbar = { :level => 'warning' }
96
98
 
97
99
  # bugsnag
98
100
  UniformNotifier.bugsnag = true
@@ -162,10 +164,6 @@ To get Growl support up-and-running, follow the steps below:
162
164
  * Restart Growl ("General" tab -> Stop Growl -> Start Growl)
163
165
  * Boot up your application. UniformNotifier will automatically send a Growl notification when Growl is turned on. If you do not see it when your application loads, make sure it is enabled in your initializer and double-check the steps above.
164
166
 
165
- ### Ruby 1.9 issue
166
-
167
- ruby-growl gem has an issue about md5 in ruby 1.9, if you use growl and ruby 1.9, check this [gist][1]
168
-
169
167
  ## XMPP/Jabber Support
170
168
 
171
169
  To get XMPP support up-and-running, follow the steps below:
@@ -178,4 +176,3 @@ To get XMPP support up-and-running, follow the steps below:
178
176
 
179
177
 
180
178
  [0]: https://github.com/flyerhzm/bullet
181
- [1]: https://gist.github.com/300184
@@ -12,9 +12,7 @@ class UniformNotifier
12
12
  message = data.values.compact.join("\n")
13
13
 
14
14
  opt = {}
15
- if UniformNotifier.airbrake.is_a?(Hash)
16
- opt = UniformNotifier.airbrake
17
- end
15
+ opt = UniformNotifier.airbrake if UniformNotifier.airbrake.is_a?(Hash)
18
16
 
19
17
  exception = Exception.new(message)
20
18
  Airbrake.notify(exception, opt)
@@ -12,12 +12,11 @@ class UniformNotifier
12
12
  message = data.values.compact.join("\n")
13
13
 
14
14
  opt = {}
15
- if UniformNotifier.honeybadger.is_a?(Hash)
16
- opt = UniformNotifier.honeybadger
17
- end
15
+ opt = UniformNotifier.honeybadger if UniformNotifier.honeybadger.is_a?(Hash)
18
16
 
19
17
  exception = Exception.new(message)
20
- Honeybadger.notify(exception, opt)
18
+ honeybadger_class = opt[:honeybadger_class] || Honeybadger
19
+ honeybadger_class.notify(exception, opt)
21
20
  end
22
21
  end
23
22
  end
@@ -2,6 +2,8 @@
2
2
 
3
3
  class UniformNotifier
4
4
  class RollbarNotifier < Base
5
+ DEFAULT_LEVEL = 'info'
6
+
5
7
  def self.active?
6
8
  !!UniformNotifier.rollbar
7
9
  end
@@ -12,7 +14,10 @@ class UniformNotifier
12
14
  message = data.values.compact.join("\n")
13
15
 
14
16
  exception = Exception.new(message)
15
- Rollbar.info(exception)
17
+ level = UniformNotifier.rollbar.fetch(:level, DEFAULT_LEVEL) if UniformNotifier.rollbar.is_a?(Hash)
18
+ level ||= DEFAULT_LEVEL
19
+
20
+ Rollbar.log(level, exception)
16
21
  end
17
22
  end
18
23
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  class UniformNotifier
4
- VERSION = '1.12.1'
4
+ VERSION = '1.13.0'
5
5
  end
@@ -12,9 +12,16 @@ RSpec.describe UniformNotifier::RollbarNotifier do
12
12
  end
13
13
 
14
14
  it 'should notify rollbar' do
15
- expect(Rollbar).to receive(:info).with(UniformNotifier::Exception.new('notify rollbar'))
15
+ expect(Rollbar).to receive(:log).with('info', UniformNotifier::Exception.new('notify rollbar'))
16
16
 
17
17
  UniformNotifier.rollbar = true
18
18
  UniformNotifier::RollbarNotifier.out_of_channel_notify(title: 'notify rollbar')
19
19
  end
20
+
21
+ it 'should notify rollbar' do
22
+ expect(Rollbar).to receive(:log).with('warning', UniformNotifier::Exception.new('notify rollbar'))
23
+
24
+ UniformNotifier.rollbar = { level: 'warning' }
25
+ UniformNotifier::RollbarNotifier.out_of_channel_notify(title: 'notify rollbar')
26
+ end
20
27
  end
@@ -14,8 +14,6 @@ Gem::Specification.new do |s|
14
14
  s.description = 'uniform notifier for rails logger, customized logger, javascript alert, javascript console, growl and xmpp'
15
15
  s.license = 'MIT'
16
16
 
17
- s.rubyforge_project = 'uniform_notifier'
18
-
19
17
  s.required_ruby_version = '>= 2.3'
20
18
 
21
19
  s.add_development_dependency 'ruby-growl', ['= 4.0']
@@ -28,4 +26,10 @@ Gem::Specification.new do |s|
28
26
  s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
29
27
  s.executables = `git ls-files -- bin/*`.split("\n").map { |f| File.basename(f) }
30
28
  s.require_paths = ['lib']
29
+
30
+ if s.respond_to?(:metadata)
31
+ s.metadata['changelog_uri'] = 'https://github.com/flyerhzm/uniform_notifier/blob/master/CHANGELOG.md'
32
+ s.metadata['source_code_uri'] = 'https://github.com/flyerhzm/uniform_notifier'
33
+ s.metadata['bug_tracker_uri'] = 'https://github.com/flyerhzm/uniform_notifier/issues'
34
+ end
31
35
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: uniform_notifier
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.12.1
4
+ version: 1.13.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Richard Huang
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-10-30 00:00:00.000000000 Z
11
+ date: 2019-10-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: ruby-growl
@@ -133,7 +133,10 @@ files:
133
133
  homepage: http://rubygems.org/gems/uniform_notifier
134
134
  licenses:
135
135
  - MIT
136
- metadata: {}
136
+ metadata:
137
+ changelog_uri: https://github.com/flyerhzm/uniform_notifier/blob/master/CHANGELOG.md
138
+ source_code_uri: https://github.com/flyerhzm/uniform_notifier
139
+ bug_tracker_uri: https://github.com/flyerhzm/uniform_notifier/issues
137
140
  post_install_message:
138
141
  rdoc_options: []
139
142
  require_paths:
@@ -149,8 +152,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
149
152
  - !ruby/object:Gem::Version
150
153
  version: '0'
151
154
  requirements: []
152
- rubyforge_project: uniform_notifier
153
- rubygems_version: 2.6.14
155
+ rubygems_version: 3.0.3
154
156
  signing_key:
155
157
  specification_version: 4
156
158
  summary: uniform notifier for rails logger, customized logger, javascript alert, javascript