uniform_notifier 1.8.0 → 1.9.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
2
  SHA1:
3
- metadata.gz: 5b6f244cf3daade27b95d8dadce002ee46035650
4
- data.tar.gz: fd8dd9175640c1c510f2139f264feff0fa997f15
3
+ metadata.gz: f8da3ce2873d3a8815e73e2949d20a318af6bf0d
4
+ data.tar.gz: 31bda16f462a5532493f63e74bb1b6a0a25a8778
5
5
  SHA512:
6
- metadata.gz: f135f3bce6f9af0199762df2ed7d47f4dc0295c0b4b9c158556cab6abe50a6563ee2cd2ea8a70b0f94468c26cbc0cce34f4294a05d1fd8846670e985adcdb060
7
- data.tar.gz: 73a98aa616a6944609b0347f615d447ba4a64076326faa02e3c3ee84fce531aabded7b1050ad0b3eff5214dbd94c25156eba989625a2ae0ea870b01739c5866e
6
+ metadata.gz: 62004481c5550047776f977309ba8cd192ca4e6c4335a3fe5a4682f9799040bce5fd3bf7b9ea32a4c1b845d2c039ee42f308360729c4052a1830f3d5c651f25c
7
+ data.tar.gz: a46b36763d83f32babe56f6e35b6547e4fdc5ab0d66517a7474c47f2e52972393a1c54e0559f990063ab4bc33c1e72ebf25bbcdd0fb1cc27c7382300b4198642
@@ -0,0 +1,44 @@
1
+ # Next Release
2
+
3
+ ## 1.9.0 (04/19/2015)
4
+
5
+ * Add `UniformNotifier::AVAILABLE_NOTIFIERS` constant
6
+
7
+ ## 1.8.0 (03/17/2015)
8
+
9
+ * Add rollbar notifier
10
+
11
+ ## 1.7.0 (02/08/2015)
12
+
13
+ * Add slack notifier
14
+
15
+ ## 1.6.0 (04/30/2014)
16
+
17
+ * Support detail notify data
18
+ * Add options for airbrake and bugsnag notifiers
19
+
20
+ ## 1.5.0 (04/26/2014)
21
+
22
+ * Add bugsnag notifier
23
+ * Use custom excaption
24
+
25
+ ## 1.4.0 (11/03/2013)
26
+
27
+ * Raise should implement `out_of_channel_notify` instead of `inline_notify`
28
+
29
+ ## 1.3.0 (08/28/2012)
30
+
31
+ * Add raise notifier
32
+
33
+ ## 1.2.0 (03/03/2013)
34
+
35
+ * Compatible with ruby-growl 4.0 gem
36
+
37
+ ## 1.1.0 (09/28/2012)
38
+
39
+ * Add growl gntp support
40
+ * Add airbrake notifier
41
+
42
+ ## 1.0.0 (11/19/2010)
43
+
44
+ * First release
@@ -12,13 +12,17 @@ require 'uniform_notifier/bugsnag'
12
12
  require 'uniform_notifier/slack'
13
13
  require 'uniform_notifier/raise'
14
14
 
15
- module UniformNotifier
15
+ class UniformNotifier
16
+ AVAILABLE_NOTIFIERS = [:alert, :console, :growl, :xmpp, :rails_logger, :customized_logger,
17
+ :airbrake, :rollbar, :bugsnag, :slack, :raise]
18
+
19
+ NOTIFIERS = [JavascriptAlert, JavascriptConsole, Growl, Xmpp, RailsLogger, CustomizedLogger,
20
+ AirbrakeNotifier, RollbarNotifier, BugsnagNotifier, Raise, Slack]
21
+
16
22
  class NotificationError < StandardError; end
17
23
 
18
24
  class <<self
19
- attr_accessor :alert, :console, :growl, :rails_logger, :xmpp, :airbrake, :rollbar, :bugsnag, :slack, :raise
20
-
21
- NOTIFIERS = [JavascriptAlert, JavascriptConsole, Growl, Xmpp, RailsLogger, CustomizedLogger, AirbrakeNotifier, BugsnagNotifier, Raise, Slack]
25
+ attr_accessor *AVAILABLE_NOTIFIERS
22
26
 
23
27
  def active_notifiers
24
28
  NOTIFIERS.select { |notifier| notifier.active? }
@@ -1,4 +1,4 @@
1
- module UniformNotifier
1
+ class UniformNotifier
2
2
  class AirbrakeNotifier < Base
3
3
  def self.active?
4
4
  !!UniformNotifier.airbrake
@@ -1,4 +1,4 @@
1
- module UniformNotifier
1
+ class UniformNotifier
2
2
  class Base
3
3
  def self.active?
4
4
  false
@@ -1,4 +1,4 @@
1
- module UniformNotifier
1
+ class UniformNotifier
2
2
  class BugsnagNotifier < Base
3
3
  def self.active?
4
4
  !!UniformNotifier.bugsnag
@@ -13,6 +13,7 @@ module UniformNotifier
13
13
  end
14
14
 
15
15
  exception = Exception.new(data[:title])
16
+ exception.set_backtrace(data[:backtrace]) if data[:backtrace]
16
17
  Bugsnag.notify(exception, opt.merge(
17
18
  :grouping_hash => data[:body] || data[:title],
18
19
  :notification => data
@@ -1,4 +1,4 @@
1
- module UniformNotifier
1
+ class UniformNotifier
2
2
  class CustomizedLogger < Base
3
3
  @logger = nil
4
4
 
@@ -1,3 +1,3 @@
1
- module UniformNotifier
1
+ class UniformNotifier
2
2
  class Exception < ::Exception; end
3
3
  end
@@ -1,4 +1,4 @@
1
- module UniformNotifier
1
+ class UniformNotifier
2
2
  class Growl < Base
3
3
  @growl = nil
4
4
 
@@ -50,7 +50,7 @@ module UniformNotifier
50
50
 
51
51
  notify 'Uniform Notifier Growl has been turned on (using GNTP)' if !growl.instance_of?(Hash) || !growl[:quiet]
52
52
  end
53
-
53
+
54
54
  protected
55
55
 
56
56
  def self._out_of_channel_notify( data )
@@ -1,9 +1,9 @@
1
- module UniformNotifier
1
+ class UniformNotifier
2
2
  class JavascriptAlert < Base
3
3
  def self.active?
4
4
  UniformNotifier.alert
5
5
  end
6
-
6
+
7
7
  protected
8
8
 
9
9
  def self._inline_notify( data )
@@ -1,4 +1,4 @@
1
- module UniformNotifier
1
+ class UniformNotifier
2
2
  class JavascriptConsole < Base
3
3
  def self.active?
4
4
  UniformNotifier.console
@@ -1,4 +1,4 @@
1
- module UniformNotifier
1
+ class UniformNotifier
2
2
  class RailsLogger < Base
3
3
  def self.active?
4
4
  UniformNotifier.rails_logger
@@ -1,4 +1,4 @@
1
- module UniformNotifier
1
+ class UniformNotifier
2
2
  class Raise < Base
3
3
  def self.active?
4
4
  @exception_class
@@ -1,4 +1,4 @@
1
- module UniformNotifier
1
+ class UniformNotifier
2
2
  class RollbarNotifier < Base
3
3
  def self.active?
4
4
  !!UniformNotifier.rollbar
@@ -1,4 +1,4 @@
1
- module UniformNotifier
1
+ class UniformNotifier
2
2
  class Slack < Base
3
3
  POSSIBLE_OPTIONS = [:username, :channel]
4
4
 
@@ -1,3 +1,3 @@
1
- module UniformNotifier
2
- VERSION = "1.8.0"
1
+ class UniformNotifier
2
+ VERSION = "1.9.0"
3
3
  end
@@ -1,4 +1,4 @@
1
- module UniformNotifier
1
+ class UniformNotifier
2
2
  class Xmpp < Base
3
3
  @receiver = nil
4
4
  @xmpp = nil
@@ -44,4 +44,13 @@ describe UniformNotifier::BugsnagNotifier do
44
44
  UniformNotifier::BugsnagNotifier.out_of_channel_notify(notification_data)
45
45
  end
46
46
  end
47
+
48
+ it "should notify bugsnag with correct backtrace" do
49
+ Bugsnag.should_receive(:notify) do |error|
50
+ error.should be_a UniformNotifier::Exception
51
+ error.backtrace.should eq ["bugsnag spec test"]
52
+ end
53
+ UniformNotifier.bugsnag = true
54
+ UniformNotifier::BugsnagNotifier.out_of_channel_notify(backtrace: ["bugsnag spec test"])
55
+ end
47
56
  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.8.0
4
+ version: 1.9.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: 2015-03-17 00:00:00.000000000 Z
11
+ date: 2015-04-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: ruby-growl
@@ -90,6 +90,7 @@ extra_rdoc_files: []
90
90
  files:
91
91
  - ".gitignore"
92
92
  - ".travis.yml"
93
+ - CHANGELOG.md
93
94
  - Gemfile
94
95
  - LICENSE
95
96
  - README.md