airbrake 11.0.1 → 11.0.3

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
  SHA256:
3
- metadata.gz: 4b780328fc01621a0273577655179008c6314c6fe5187e5562f15c5112f296cd
4
- data.tar.gz: 3036e80e03bbb2fa4159a9167a6971adcda2dcbee789ed3db320c0eaf0408d9b
3
+ metadata.gz: bd22c4ba5f388c063021267c805f9f72f9905c8e0f7a2b7e19d0f6a45c9718a9
4
+ data.tar.gz: b919ee2bdae1a073c939b752d9827f3d8ecd6c30f18739019f9becbf6974a605
5
5
  SHA512:
6
- metadata.gz: f307768db070afd129623ed312e7f4da4e4040f1bdf33cb9d1e31f2f1ee4278e992eac0e901a6bb257042ff9aff5f651c2a8bd74579606771c56d4040e63c0b1
7
- data.tar.gz: b6376325c1b352ac7f13a0a0467737fb2a8cb08a12748c10d991265342119bcd6f510271744facb11018312de593857835aceadef557c20bbf1e85a2296e7bd4
6
+ metadata.gz: 2362a03c41aebeddaf2e6bcd2272760ea0fb94b88a0dcabb644ab5c9b3a72ed72281f05f314f04491e27d99fae9c5353bbfaa4fc1d43f09d3e2316f6edfb02ba
7
+ data.tar.gz: f260895a27e6f8e2368c2be1431344291d5dcdf731f0d4b71d4ab2f14de1265cb93759c888ad03592b02dabaa7944e9c4dfbfed4fb87b443e3aaddeba0321760
@@ -10,26 +10,28 @@ require 'airbrake/rails/action_cable/notify_callback'
10
10
  end
11
11
  end
12
12
 
13
- module ActionCable
14
- module Channel
15
- # @since v8.3.0
16
- # @api private
17
- # @see https://github.com/rails/rails/blob/master/actioncable/lib/action_cable/channel/base.rb
18
- class Base
19
- alias perform_action_without_airbrake perform_action
13
+ module Airbrake
14
+ module ActionCable
15
+ module Channel
16
+ # @since v8.3.0
17
+ # @api private
18
+ # @see https://github.com/rails/rails/blob/master/actioncable/lib/action_cable/channel/base.rb
19
+ module Base
20
+ def perform_action(*args, &block)
21
+ super(*args, &block)
22
+ rescue Exception => ex # rubocop:disable Lint/RescueException
23
+ Airbrake.notify(ex) do |notice|
24
+ notice.stash[:action_cable_connection] = connection
25
+ notice[:context][:component] = self.class
26
+ notice[:context][:action] = args.first['action']
27
+ notice[:params].merge!(args.first)
28
+ end
20
29
 
21
- def perform_action(*args, &block)
22
- perform_action_without_airbrake(*args, &block)
23
- rescue Exception => ex # rubocop:disable Lint/RescueException
24
- Airbrake.notify(ex) do |notice|
25
- notice.stash[:action_cable_connection] = connection
26
- notice[:context][:component] = self.class
27
- notice[:context][:action] = args.first['action']
28
- notice[:params].merge!(args.first)
30
+ raise ex
29
31
  end
30
-
31
- raise ex
32
32
  end
33
33
  end
34
34
  end
35
35
  end
36
+
37
+ ActionCable::Channel::Base.prepend(Airbrake::ActionCable::Channel::Base)
@@ -1,14 +1,18 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- module HTTP
4
- # Monkey-patch to measure request timing.
5
- class Client
6
- alias perform_without_airbrake perform
7
-
8
- def perform(request, options)
9
- Airbrake::Rack.capture_timing(:http) do
10
- perform_without_airbrake(request, options)
3
+ module Airbrake
4
+ module Rails
5
+ # Monkey-patch to measure request timing.
6
+ # @api private
7
+ # @since v11.0.2
8
+ module HTTP
9
+ def perform(request, options)
10
+ Airbrake::Rack.capture_timing(:http) do
11
+ super(request, options)
12
+ end
11
13
  end
12
14
  end
13
15
  end
14
16
  end
17
+
18
+ HTTP::Client.prepend(Airbrake::Rails::HTTP)
data/lib/airbrake/rake.rb CHANGED
@@ -5,61 +5,62 @@
5
5
  # See: https://goo.gl/ksn6PE
6
6
  Rake::TaskManager.record_task_metadata = true
7
7
 
8
- module Rake
9
- # Redefine +Rake::Task#execute+, so it can report errors to Airbrake.
10
- class Task
11
- # Store the original method to use it later.
12
- alias execute_without_airbrake execute
13
-
14
- # A wrapper around the original +#execute+, that catches all errors and
15
- # notifies Airbrake.
16
- #
17
- # rubocop:disable Lint/RescueException
18
- def execute(args = nil)
19
- execute_without_airbrake(args)
20
- rescue Exception => ex
21
- notify_airbrake(ex, args)
22
- raise ex
23
- end
24
- # rubocop:enable Lint/RescueException
8
+ module Airbrake
9
+ module Rake
10
+ # Redefine +Rake::Task#execute+, so it can report errors to Airbrake.
11
+ module Task
12
+ # A wrapper around the original +#execute+, that catches all errors and
13
+ # notifies Airbrake.
14
+ #
15
+ # rubocop:disable Lint/RescueException
16
+ def execute(args = nil)
17
+ super(args)
18
+ rescue Exception => ex
19
+ notify_airbrake(ex, args)
20
+ raise ex
21
+ end
22
+ # rubocop:enable Lint/RescueException
25
23
 
26
- private
24
+ private
27
25
 
28
- def notify_airbrake(exception, args)
29
- notice = Airbrake.build_notice(exception)
30
- notice[:context][:component] = 'rake'
31
- notice[:context][:action] = name
32
- notice[:params].merge!(
33
- rake_task: task_info,
34
- execute_args: args,
35
- argv: ARGV.join(' '),
36
- )
26
+ def notify_airbrake(exception, args)
27
+ notice = Airbrake.build_notice(exception)
28
+ notice[:context][:component] = 'rake'
29
+ notice[:context][:action] = name
30
+ notice[:params].merge!(
31
+ rake_task: task_info,
32
+ execute_args: args,
33
+ argv: ARGV.join(' '),
34
+ )
37
35
 
38
- Airbrake.notify_sync(notice)
39
- end
36
+ Airbrake.notify_sync(notice)
37
+ end
40
38
 
41
- # rubocop:disable Metrics/CyclomaticComplexity, Metrics/AbcSize
42
- def task_info
43
- info = {}
39
+ # rubocop:disable Metrics/CyclomaticComplexity, Metrics/AbcSize
40
+ def task_info
41
+ info = {}
44
42
 
45
- info[:name] = name
46
- info[:timestamp] = timestamp.to_s
47
- info[:investigation] = investigation
43
+ info[:name] = name
44
+ info[:timestamp] = timestamp.to_s
45
+ info[:investigation] = investigation
48
46
 
49
- info[:full_comment] = full_comment if full_comment
50
- info[:arg_names] = arg_names if arg_names.any?
51
- info[:arg_description] = arg_description if arg_description
52
- info[:locations] = locations if locations.any?
53
- info[:sources] = sources if sources.any?
47
+ info[:full_comment] = full_comment if full_comment
48
+ info[:arg_names] = arg_names if arg_names.any?
49
+ info[:arg_description] = arg_description if arg_description
50
+ info[:locations] = locations if locations.any?
51
+ info[:sources] = sources if sources.any?
54
52
 
55
- if prerequisite_tasks.any?
56
- info[:prerequisite_tasks] = prerequisite_tasks.map do |p|
57
- p.__send__(:task_info)
53
+ if prerequisite_tasks.any?
54
+ info[:prerequisite_tasks] = prerequisite_tasks.map do |p|
55
+ p.__send__(:task_info)
56
+ end
58
57
  end
59
- end
60
58
 
61
- info
59
+ info
60
+ end
61
+ # rubocop:enable Metrics/CyclomaticComplexity, Metrics/AbcSize
62
62
  end
63
- # rubocop:enable Metrics/CyclomaticComplexity, Metrics/AbcSize
64
63
  end
65
64
  end
65
+
66
+ Rake::Task.prepend(Airbrake::Rake::Task)
@@ -30,32 +30,33 @@ module Resque
30
30
  end
31
31
  end
32
32
 
33
- module Resque
34
- # Measures elapsed time of a job and notifies Airbrake of the execution
35
- # status.
36
- #
37
- # @since v9.6.0
38
- class Job
39
- # Store the original method to use it later.
40
- alias perform_without_airbrake perform
41
-
42
- def perform
43
- timing = Airbrake::Benchmark.measure do
44
- perform_without_airbrake
33
+ module Airbrake
34
+ module Resque
35
+ # Measures elapsed time of a job and notifies Airbrake of the execution
36
+ # status.
37
+ #
38
+ # @since v9.6.0
39
+ module Job
40
+ def perform
41
+ timing = Airbrake::Benchmark.measure do
42
+ super
43
+ end
44
+ rescue StandardError => exception
45
+ Airbrake.notify_queue_sync(
46
+ queue: payload['class'],
47
+ error_count: 1,
48
+ timing: 0.01,
49
+ )
50
+ raise exception
51
+ else
52
+ Airbrake.notify_queue_sync(
53
+ queue: payload['class'],
54
+ error_count: 0,
55
+ timing: timing,
56
+ )
45
57
  end
46
- rescue StandardError => exception
47
- Airbrake.notify_queue_sync(
48
- queue: payload['class'],
49
- error_count: 1,
50
- timing: 0.01,
51
- )
52
- raise exception
53
- else
54
- Airbrake.notify_queue_sync(
55
- queue: payload['class'],
56
- error_count: 0,
57
- timing: timing,
58
- )
59
58
  end
60
59
  end
61
60
  end
61
+
62
+ Resque::Job.prepend(Airbrake::Resque::Job)
@@ -39,34 +39,36 @@ end
39
39
 
40
40
  Sneakers.error_reporters << Airbrake::Sneakers::ErrorReporter.new
41
41
 
42
- module Sneakers
43
- # @todo Migrate to Sneakers v2.12.0 middleware API when it's released
44
- # @see https://github.com/jondot/sneakers/pull/364
45
- module Worker
46
- # Sneakers v2.7.0+ renamed `do_work` to `process_work`.
47
- if method_defined?(:process_work)
48
- alias process_work_without_airbrake process_work
49
- else
50
- alias process_work_without_airbrake do_work
51
- end
52
-
53
- def process_work(delivery_info, metadata, msg, handler)
54
- timing = Airbrake::Benchmark.measure do
55
- process_work_without_airbrake(delivery_info, metadata, msg, handler)
42
+ module Airbrake
43
+ module Sneakers
44
+ # @todo Migrate to Sneakers v2.12.0 middleware API when it's released
45
+ # @see https://github.com/jondot/sneakers/pull/364
46
+ module Worker
47
+ # Sneakers v2.7.0+ renamed `do_work` to `process_work`.
48
+ define_method(
49
+ ::Sneakers::Worker.method_defined?(:process_work) ? :process_work : :do_work,
50
+ ) do |delivery_info, metadata, msg, handler|
51
+ begin
52
+ timing = Airbrake::Benchmark.measure do
53
+ super(delivery_info, metadata, msg, handler)
54
+ end
55
+ rescue Exception => exception # rubocop:disable Lint/RescueException
56
+ Airbrake.notify_queue(
57
+ queue: self.class.to_s,
58
+ error_count: 1,
59
+ timing: 0.01,
60
+ )
61
+ raise exception
62
+ else
63
+ Airbrake.notify_queue(
64
+ queue: self.class.to_s,
65
+ error_count: 0,
66
+ timing: timing,
67
+ )
68
+ end
56
69
  end
57
- rescue Exception => exception # rubocop:disable Lint/RescueException
58
- Airbrake.notify_queue(
59
- queue: self.class.to_s,
60
- error_count: 1,
61
- timing: 0.01,
62
- )
63
- raise exception
64
- else
65
- Airbrake.notify_queue(
66
- queue: self.class.to_s,
67
- error_count: 0,
68
- timing: timing,
69
- )
70
70
  end
71
71
  end
72
72
  end
73
+
74
+ Sneakers::Worker.prepend(Airbrake::Sneakers::Worker)
@@ -3,5 +3,5 @@
3
3
  # We use Semantic Versioning v2.0.0
4
4
  # More information: http://semver.org/
5
5
  module Airbrake
6
- AIRBRAKE_VERSION = '11.0.1'
6
+ AIRBRAKE_VERSION = '11.0.3'
7
7
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: airbrake
3
3
  version: !ruby/object:Gem::Version
4
- version: 11.0.1
4
+ version: 11.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Airbrake Technologies, Inc.
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-10-20 00:00:00.000000000 Z
11
+ date: 2021-05-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: airbrake-ruby
@@ -58,14 +58,14 @@ dependencies:
58
58
  requirements:
59
59
  - - "~>"
60
60
  - !ruby/object:Gem::Version
61
- version: '12'
61
+ version: '13'
62
62
  type: :development
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
66
  - - "~>"
67
67
  - !ruby/object:Gem::Version
68
- version: '12'
68
+ version: '13'
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: pry
71
71
  requirement: !ruby/object:Gem::Requirement
@@ -170,14 +170,14 @@ dependencies:
170
170
  requirements:
171
171
  - - '='
172
172
  - !ruby/object:Gem::Version
173
- version: 3.3.3
173
+ version: 4.1.4
174
174
  type: :development
175
175
  prerelease: false
176
176
  version_requirements: !ruby/object:Gem::Requirement
177
177
  requirements:
178
178
  - - '='
179
179
  - !ruby/object:Gem::Version
180
- version: 3.3.3
180
+ version: 4.1.4
181
181
  - !ruby/object:Gem::Dependency
182
182
  name: sidekiq
183
183
  requirement: !ruby/object:Gem::Requirement
@@ -262,26 +262,40 @@ dependencies:
262
262
  - - "~>"
263
263
  - !ruby/object:Gem::Version
264
264
  version: '1.3'
265
+ - !ruby/object:Gem::Dependency
266
+ name: ethon
267
+ requirement: !ruby/object:Gem::Requirement
268
+ requirements:
269
+ - - '='
270
+ - !ruby/object:Gem::Version
271
+ version: 0.12.0
272
+ type: :development
273
+ prerelease: false
274
+ version_requirements: !ruby/object:Gem::Requirement
275
+ requirements:
276
+ - - '='
277
+ - !ruby/object:Gem::Version
278
+ version: 0.12.0
265
279
  - !ruby/object:Gem::Dependency
266
280
  name: public_suffix
267
281
  requirement: !ruby/object:Gem::Requirement
268
282
  requirements:
269
283
  - - "~>"
270
284
  - !ruby/object:Gem::Version
271
- version: '2.0'
285
+ version: '4.0'
272
286
  - - "<"
273
287
  - !ruby/object:Gem::Version
274
- version: '3.0'
288
+ version: '5.0'
275
289
  type: :development
276
290
  prerelease: false
277
291
  version_requirements: !ruby/object:Gem::Requirement
278
292
  requirements:
279
293
  - - "~>"
280
294
  - !ruby/object:Gem::Version
281
- version: '2.0'
295
+ version: '4.0'
282
296
  - - "<"
283
297
  - !ruby/object:Gem::Version
284
- version: '3.0'
298
+ version: '5.0'
285
299
  - !ruby/object:Gem::Dependency
286
300
  name: redis-namespace
287
301
  requirement: !ruby/object:Gem::Requirement