raygun4ruby 1.1.1 → 1.1.2
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 +4 -4
- data/lib/raygun/sidekiq.rb +41 -0
- data/lib/raygun/version.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d60156ce8457a817f37b25be18c330c425168c02
|
4
|
+
data.tar.gz: 6910263dfeef71f41e86faff38b0d675ca9f8a3e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 231b498a6cfa379ac0a39faf8f64aaff661c738256849db5c8b84f95272ea21d8dbf2812100e7a02f2b53e4c25e77e98a75064f3e32aee8c4f869530fc15322a
|
7
|
+
data.tar.gz: 42b1dcc424ad28ca4307ab2e5cb54f18d7b184ac917ef75799fce6241e35b0bf4e03ea8892802a31d99936f73c3075f98ebf83ec869f8f77a240eeb9880a8c36
|
@@ -0,0 +1,41 @@
|
|
1
|
+
# Adapted from Bugsnag code as per Sidekiq 2.x comment request
|
2
|
+
#
|
3
|
+
# SideKiq 2.x: https://github.com/mperham/sidekiq/blob/2-x/lib/sidekiq/exception_handler.rb
|
4
|
+
# Bugsnag: https://github.com/bugsnag/bugsnag-ruby/blob/master/lib/bugsnag/sidekiq.rb
|
5
|
+
|
6
|
+
module Raygun
|
7
|
+
|
8
|
+
class SidekiqMiddleware # Used for Sidekiq 2.x only
|
9
|
+
def call(worker, message, queue)
|
10
|
+
begin
|
11
|
+
yield
|
12
|
+
rescue Exception => ex
|
13
|
+
raise ex if [Interrupt, SystemExit, SignalException].include?(ex.class)
|
14
|
+
SidekiqReporter.call(ex, worker: worker, message: message, queue: queue)
|
15
|
+
raise ex
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
19
|
+
|
20
|
+
class SidekiqReporter
|
21
|
+
def self.call(exception, context_hash)
|
22
|
+
::Raygun.track_exception(exception,
|
23
|
+
custom_data: {
|
24
|
+
sidekiq_context: context_hash
|
25
|
+
}
|
26
|
+
)
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end
|
30
|
+
|
31
|
+
if Sidekiq::VERSION < '3'
|
32
|
+
Sidekiq.configure_server do |config|
|
33
|
+
config.server_middleware do |chain|
|
34
|
+
chain.add Raygun::SidekiqMiddleware
|
35
|
+
end
|
36
|
+
end
|
37
|
+
else
|
38
|
+
Sidekiq.configure_server do |config|
|
39
|
+
config.error_handlers << Raygun::SidekiqReporter
|
40
|
+
end
|
41
|
+
end
|
data/lib/raygun/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: raygun4ruby
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.1.
|
4
|
+
version: 1.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Mindscape
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2014-05-
|
12
|
+
date: 2014-05-27 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: httparty
|
@@ -180,6 +180,7 @@ files:
|
|
180
180
|
- lib/raygun/middleware/rack_exception_interceptor.rb
|
181
181
|
- lib/raygun/middleware/rails_insert_affected_user.rb
|
182
182
|
- lib/raygun/railtie.rb
|
183
|
+
- lib/raygun/sidekiq.rb
|
183
184
|
- lib/raygun/testable.rb
|
184
185
|
- lib/raygun/version.rb
|
185
186
|
- lib/raygun4ruby.rb
|