exception_notification-bugsnag 0.3.0 → 0.4.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
  SHA256:
3
- metadata.gz: 377620e242a32e9091f4689c4b3bca4de192f589ec5facf7a3f13b8345089c69
4
- data.tar.gz: d93589de4b983219d7fa56b0a480505ccc0796baa84c462b34349d5e96a0817a
3
+ metadata.gz: b785df57b8e91049409af97bca90722fbc12626e81d505930874d81a818a865a
4
+ data.tar.gz: 77461d215cfe228f07ddc9ccb3cad8fe3a4a386cf2e5c761622069d5d276fb51
5
5
  SHA512:
6
- metadata.gz: e86291e53b4532bfce0d179d36b5da02db476169dbf8ab7d9b59ca55eb84a9e2c7127b2f79896335d7917e9a1070c96c6f9b946d55ec59fae8333bb1c98b0484
7
- data.tar.gz: abb0e8bb81cf99db41b8dc8f2318635c446da957c79322922bd43c97446bbca27ad7924c456a546343935536c03197fcccea9efd788de22810db69b6137aabd9
6
+ metadata.gz: 45f8aa7e0aa0f8b29c6b6ba5a5cb39e4999cd62a1e9f18200ee237ddf31810b296c7d6ceb26f33752e44b345832d2f8abc62747e7749336f988a5f71075dc40d
7
+ data.tar.gz: db9a851a54cb39cd241de0acc3c8f9a0524e7f2152e2140f4a6d57dab34b890ed155093350e6da6332babbdb60a304801a4e451fd10d4ce5687e2aca41f9c20e
@@ -1,8 +1,13 @@
1
1
  language: ruby
2
+
2
3
  rvm:
3
- - 2.2.9
4
- - 2.3.6
5
- - 2.4.3
6
- - 2.5.0
4
+ - 2.3.8
5
+ - 2.4.5
6
+ - 2.5.3
7
+ - 2.6.1
8
+
9
+ cache: bundler
7
10
 
8
- before_install: 'gem update --system'
11
+ before_install:
12
+ - gem update --system
13
+ - gem install bundler
@@ -1,24 +1,69 @@
1
- Changelog
2
- ====
1
+ # Changelog
3
2
 
4
3
 
5
- [unreleased](https://github.com/pocke/exception_notification-bugsnag/compare/v0.2.0...master)
6
- ----
4
+ ## unreleased
7
5
 
8
- [Full Changelog](https://github.com/pocke/exception_notification-bugsnag/compare/v0.2.0...master)
6
+ [Full Changelog](https://github.com/pocke/exception_notification-bugsnag/compare/v0.4.0...master)
7
+
8
+ ### Breaking Changes:
9
9
 
10
10
  ### Enhancements:
11
11
 
12
12
  ### Fixed Bugs:
13
13
 
14
14
 
15
- [0.2.0](https://github.com/pocke/exception_notification-bugsnag/compare/v0.1.0...v0.2.0)
16
- ----
15
+ ## 0.4.0
17
16
 
18
- [Full Changelog](https://github.com/pocke/exception_notification-bugsnag/compare/v0.1.0...v0.2.0)
17
+ [Full Changelog](https://github.com/pocke/exception_notification-bugsnag/compare/v0.3.0...v0.4.0)
18
+
19
+ ### Breaking Changes:
20
+
21
+ - [#17](https://github.com/pocke/exception_notification-bugsnag/pull/17) Requires `ruby >= 2.3.0`. ([@ybiquitous](https://github.com/ybiquitous))
22
+
23
+ ### Fixed Bugs:
24
+
25
+ - [#16](https://github.com/pocke/exception_notification-bugsnag/pull/16) Support Sidekiq & Resque. ([@ybiquitous](https://github.com/ybiquitous))
26
+
27
+
28
+ ## 0.3.0
29
+
30
+ [Full Changelog](https://github.com/pocke/exception_notification-bugsnag/compare/v0.3.0.preview2...v0.3.0)
31
+
32
+ ### Breaking Changes:
33
+
34
+ - Requires `exception_notification >= 4.3.0`.
35
+
36
+ ### Fixed Bugs:
37
+
38
+ - [#11](https://github.com/pocke/exception_notification-bugsnag/pull/11) Handle "Rack Env" object. ([@ybiquitous](https://github.com/ybiquitous))
19
39
 
20
- ### Breaking changes:
21
40
 
22
- - [#1 Use notify instead of auto notify by wata727](https://github.com/pocke/exception_notification-bugsnag/pull/1)
41
+ ## 0.3.0.preview2
42
+
43
+ [Full Changelog](https://github.com/pocke/exception_notification-bugsnag/compare/v0.3.0.preview1...v0.3.0.preview2)
44
+
45
+ ### Breaking Changes:
46
+
47
+ - Requires `bugsnag >= 6`.
23
48
 
24
49
  ### Fixed Bugs:
50
+
51
+ - [#8](https://github.com/pocke/exception_notification-bugsnag/pull/8) Support Bugsnag 6 correctly. ([@ybiquitous](https://github.com/ybiquitous))
52
+
53
+
54
+ ## 0.3.0.preview1
55
+
56
+ [Full Changelog](https://github.com/pocke/exception_notification-bugsnag/compare/v0.2.0...v0.3.0.preview1)
57
+
58
+ ### Breaking Changes:
59
+
60
+ - [#6](https://github.com/pocke/exception_notification-bugsnag/pull/6) Support Bugsnag gem version 6. ([@pocke](https://github.com/pocke))
61
+
62
+
63
+ ## 0.2.0
64
+
65
+ [Full Changelog](https://github.com/pocke/exception_notification-bugsnag/compare/v0.1.0...v0.2.0)
66
+
67
+ ### Breaking Changes:
68
+
69
+ - [#1](https://github.com/pocke/exception_notification-bugsnag/pull/1) Use notify instead of auto notify. ([@wata727](https://github.com/wata727))
@@ -12,14 +12,16 @@ Gem::Specification.new do |spec|
12
12
 
13
13
  spec.summary = %q{Send exception info to Bugsnag.}
14
14
  spec.description = %q{Send exception info to Bugsnag.}
15
- spec.homepage = "https://github.com/koshigoe/exception_notification-bugsnag"
15
+ spec.homepage = "https://github.com/pocke/exception_notification-bugsnag"
16
16
 
17
17
  spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
18
18
  spec.bindir = "exe"
19
19
  spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
20
20
  spec.require_paths = ["lib"]
21
21
 
22
- spec.add_development_dependency "bundler", "~> 1.9"
22
+ spec.required_ruby_version = ">= 2.3.0"
23
+
24
+ spec.add_development_dependency "bundler", "~> 2.0"
23
25
  spec.add_development_dependency "rake", "~> 10.0"
24
26
  spec.add_development_dependency "rspec"
25
27
 
@@ -12,19 +12,22 @@ module ExceptionNotifier
12
12
 
13
13
  wrapped_block = proc do |report|
14
14
  options.each do |key, value|
15
- # NOTE: `:env` option can be passed as a Rack Env object by `ExceptionNotification::Rack`.
16
- # Bugsnag provides the way to report the Env object by default.
17
- #
18
- # See below:
19
- # - https://github.com/smartinez87/exception_notification/blob/2443af19e4c7433c7439c6ff01922a54023b89dd/lib/exception_notification/rack.rb#L51
20
- # - https://github.com/bugsnag/bugsnag-ruby/blob/46d345d93dcb715c977615d24b369da204ed7b72/lib/bugsnag/middleware/rack_request.rb#L74-L76
21
- # - https://docs.bugsnag.com/platforms/ruby/rails/configuration-options/#send_environment
22
- if key == :env
23
- if report.configuration.send_environment
24
- report.add_tab(:environment, value)
25
- end
26
- else
15
+ case
16
+ when support_rack?(key)
17
+ process_rack(report, value)
18
+ when support_sidekiq?(key, value)
19
+ process_sidekiq(report, value)
20
+ when support_resque?(key, value)
21
+ process_resque(report, value)
22
+
23
+ # Support any attributes.
24
+ when report.respond_to?("#{key}=")
27
25
  report.public_send("#{key}=", value)
26
+
27
+ # Just warn instead of an error because it's tough to support
28
+ # all data formats which ExceptionNotification may pass.
29
+ else
30
+ warn "#{self.class.name} does not know the data: `#{key.inspect}=>#{value.inspect}`"
28
31
  end
29
32
  end
30
33
 
@@ -33,5 +36,45 @@ module ExceptionNotifier
33
36
 
34
37
  Bugsnag.notify(exception, &wrapped_block)
35
38
  end
39
+
40
+ private
41
+
42
+ # `:env` option can be passed as a Rack Env object by `ExceptionNotification::Rack`.
43
+ # Bugsnag provides the way to report the Env object by default.
44
+ #
45
+ # @see https://github.com/smartinez87/exception_notification/blob/v4.3.0/lib/exception_notification/rack.rb#L51
46
+ # @see https://github.com/bugsnag/bugsnag-ruby/blob/v6.0.0/lib/bugsnag/middleware/rack_request.rb#L61-L63
47
+ # @see https://docs.bugsnag.com/platforms/ruby/rails/configuration-options/#send_environment
48
+ def support_rack?(key)
49
+ key == :env
50
+ end
51
+
52
+ def process_rack(report, value)
53
+ if report.configuration.send_environment
54
+ report.add_tab(:environment, value)
55
+ end
56
+ end
57
+
58
+ # Support Sidekiq data format.
59
+ #
60
+ # @see https://github.com/smartinez87/exception_notification/blob/v4.3.0/lib/exception_notification/sidekiq.rb#L28
61
+ def support_sidekiq?(key, value)
62
+ key == :data && value.is_a?(Hash) && value.include?(:sidekiq)
63
+ end
64
+
65
+ def process_sidekiq(report, value)
66
+ report.add_tab(:sidekiq, value[:sidekiq])
67
+ end
68
+
69
+ # Support Resque data format.
70
+ #
71
+ # @see https://github.com/smartinez87/exception_notification/blob/v4.3.0/lib/exception_notification/resque.rb#L20
72
+ def support_resque?(key, value)
73
+ key == :data && value.is_a?(Hash) && value.include?(:resque)
74
+ end
75
+
76
+ def process_resque(report, value)
77
+ report.add_tab(:resque, value[:resque])
78
+ end
36
79
  end
37
80
  end
@@ -1,5 +1,5 @@
1
1
  module ExceptionNotification
2
2
  module Bugsnag
3
- VERSION = "0.3.0"
3
+ VERSION = "0.4.0"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: exception_notification-bugsnag
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - koshigoe
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2018-12-10 00:00:00.000000000 Z
11
+ date: 2019-02-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: '1.9'
19
+ version: '2.0'
20
20
  type: :development
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: '1.9'
26
+ version: '2.0'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: rake
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -103,7 +103,7 @@ files:
103
103
  - lib/exception_notification/bugsnag.rb
104
104
  - lib/exception_notification/bugsnag/version.rb
105
105
  - lib/exception_notifier/bugsnag_notifier.rb
106
- homepage: https://github.com/koshigoe/exception_notification-bugsnag
106
+ homepage: https://github.com/pocke/exception_notification-bugsnag
107
107
  licenses:
108
108
  - MIT
109
109
  metadata: {}
@@ -115,15 +115,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
115
115
  requirements:
116
116
  - - ">="
117
117
  - !ruby/object:Gem::Version
118
- version: '0'
118
+ version: 2.3.0
119
119
  required_rubygems_version: !ruby/object:Gem::Requirement
120
120
  requirements:
121
121
  - - ">="
122
122
  - !ruby/object:Gem::Version
123
123
  version: '0'
124
124
  requirements: []
125
- rubyforge_project:
126
- rubygems_version: 2.7.8
125
+ rubygems_version: 3.0.2
127
126
  signing_key:
128
127
  specification_version: 4
129
128
  summary: Send exception info to Bugsnag.