airbrake 10.0.0 → 10.0.5

Sign up to get free protection for your applications and to get access to all the features.
Files changed (50) hide show
  1. checksums.yaml +4 -4
  2. data/lib/airbrake.rb +2 -0
  3. data/lib/airbrake/capistrano.rb +2 -0
  4. data/lib/airbrake/capistrano/capistrano2.rb +2 -0
  5. data/lib/airbrake/capistrano/capistrano3.rb +2 -0
  6. data/lib/airbrake/delayed_job.rb +4 -2
  7. data/lib/airbrake/logger.rb +2 -0
  8. data/lib/airbrake/rack.rb +2 -0
  9. data/lib/airbrake/rack/context_filter.rb +2 -0
  10. data/lib/airbrake/rack/http_headers_filter.rb +2 -0
  11. data/lib/airbrake/rack/http_params_filter.rb +2 -0
  12. data/lib/airbrake/rack/instrumentable.rb +112 -4
  13. data/lib/airbrake/rack/middleware.rb +2 -0
  14. data/lib/airbrake/rack/request_body_filter.rb +2 -0
  15. data/lib/airbrake/rack/request_store.rb +2 -0
  16. data/lib/airbrake/rack/route_filter.rb +2 -0
  17. data/lib/airbrake/rack/session_filter.rb +2 -0
  18. data/lib/airbrake/rack/user.rb +2 -0
  19. data/lib/airbrake/rack/user_filter.rb +2 -0
  20. data/lib/airbrake/rails.rb +2 -0
  21. data/lib/airbrake/rails/action_cable.rb +2 -0
  22. data/lib/airbrake/rails/action_cable/notify_callback.rb +2 -0
  23. data/lib/airbrake/rails/action_controller.rb +2 -0
  24. data/lib/airbrake/rails/action_controller_notify_subscriber.rb +2 -0
  25. data/lib/airbrake/rails/action_controller_performance_breakdown_subscriber.rb +2 -0
  26. data/lib/airbrake/rails/action_controller_route_subscriber.rb +2 -0
  27. data/lib/airbrake/rails/active_job.rb +4 -10
  28. data/lib/airbrake/rails/active_record.rb +2 -0
  29. data/lib/airbrake/rails/active_record_subscriber.rb +2 -0
  30. data/lib/airbrake/rails/app.rb +12 -0
  31. data/lib/airbrake/rails/backtrace_cleaner.rb +13 -0
  32. data/lib/airbrake/rails/curb.rb +2 -0
  33. data/lib/airbrake/rails/event.rb +2 -0
  34. data/lib/airbrake/rails/excon_subscriber.rb +2 -0
  35. data/lib/airbrake/rails/http.rb +2 -0
  36. data/lib/airbrake/rails/http_client.rb +2 -0
  37. data/lib/airbrake/rails/net_http.rb +14 -6
  38. data/lib/airbrake/rails/railtie.rb +21 -8
  39. data/lib/airbrake/rails/typhoeus.rb +2 -0
  40. data/lib/airbrake/rake.rb +2 -0
  41. data/lib/airbrake/rake/tasks.rb +5 -3
  42. data/lib/airbrake/resque.rb +2 -0
  43. data/lib/airbrake/shoryuken.rb +2 -0
  44. data/lib/airbrake/sidekiq.rb +2 -0
  45. data/lib/airbrake/sidekiq/retryable_jobs_filter.rb +2 -0
  46. data/lib/airbrake/sneakers.rb +6 -1
  47. data/lib/airbrake/version.rb +3 -1
  48. data/lib/generators/airbrake_generator.rb +2 -0
  49. data/lib/generators/airbrake_initializer.rb.erb +5 -3
  50. metadata +23 -10
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 83054730bd07260d0293206623452abacfc4b0006f65900811bac214a026c8a0
4
- data.tar.gz: dee0bf02404e401d98b065e0550cffb4fb8bdec9e208cb31d4e37155a4b9e29c
3
+ metadata.gz: b9cbd8ee322463da5c2a1e5204c2f43d487670e55d15800013e4160a74a15d32
4
+ data.tar.gz: 9be1aa686e18c3a14cc49ad33c55ba61684d89131e2e94b8eeb8dbde3e9d0ee4
5
5
  SHA512:
6
- metadata.gz: b62c7face7778e77164b5f5222c64b6623984e2925a5b1928de2eb9a5b15a224111aa87b427cdb79b6626e0ae0bee0fc2d59b0780bfc6e5d852f227d4ed4679b
7
- data.tar.gz: 41407ade81d73fb1594c67ebd26311f69d3888445fa8b28ae23a0a48031a323dc9ac4a68dc6a9906b532e0855b2878edf9712565b5ef458ec2e9250d59864c2f
6
+ metadata.gz: c2ee7d1114b0f9d21a641434a75f44083a0fe47e3b39940ecad78d482763a46bc25d45cc76c9b9c678a7ac063e1449cdd9ff8e95df2c73037ece41686048732e
7
+ data.tar.gz: 026c23e666b93041f466a5d5ca1648884db567878d013cea50993ee0785b92357b5ef8e82d97545ace088bf07032bf8493f5d42da6189454af78475685d2e902
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'shellwords'
2
4
  require 'English'
3
5
 
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  if defined?(Capistrano::VERSION) &&
2
4
  Gem::Version.new(Capistrano::VERSION).release >= Gem::Version.new('3.0.0')
3
5
  require 'airbrake/capistrano/capistrano3'
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Airbrake
2
4
  # The Capistrano v2 integration.
3
5
  module Capistrano
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  namespace :airbrake do
2
4
  desc "Notify Airbrake of the deploy"
3
5
  task :deploy do
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Delayed
2
4
  module Plugins
3
5
  # Provides integration with Delayed Job.
@@ -26,7 +28,7 @@ module Delayed
26
28
  notice[:context][:action] = action
27
29
  end
28
30
 
29
- ::Airbrake.notify_queue_sync(
31
+ ::Airbrake.notify_queue(
30
32
  queue: action,
31
33
  error_count: 1,
32
34
  timing: 0.01,
@@ -34,7 +36,7 @@ module Delayed
34
36
 
35
37
  raise exception
36
38
  else
37
- ::Airbrake.notify_queue_sync(
39
+ ::Airbrake.notify_queue(
38
40
  queue: job_class || job.payload_object.class.name,
39
41
  error_count: 0,
40
42
  timing: timing,
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'logger'
2
4
  require 'delegate'
3
5
 
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'airbrake/rack/user'
2
4
  require 'airbrake/rack/user_filter'
3
5
  require 'airbrake/rack/context_filter'
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Airbrake
2
4
  module Rack
3
5
  # Adds context (URL, User-Agent, framework version, controller and more).
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Airbrake
2
4
  module Rack
3
5
  # Adds HTTP request parameters.
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Airbrake
2
4
  module Rack
3
5
  # Adds HTTP request parameters.
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Airbrake
2
4
  module Rack
3
5
  # Instrumentable holds methods that simplify instrumenting Rack apps.
@@ -15,14 +17,120 @@ module Airbrake
15
17
  # @since v9.2.0
16
18
  module Instrumentable
17
19
  def airbrake_capture_timing(method_name, label: method_name.to_s)
18
- alias_method "#{method_name}_without_airbrake", method_name
20
+ instrumentable = ::Airbrake::Rack::Instrumentable
21
+ if instrumentable.should_prepend?(self, method_name)
22
+ instrumentable.prepend_capture_timing(self, method_name, label)
23
+ else
24
+ instrumentable.chain_capture_timing(self, method_name, label)
25
+ end
26
+ method_name
27
+ end
28
+
29
+ # @api private
30
+ def __airbrake_capture_timing_module__
31
+ # Module used to store prepended wrapper methods, saved as an instance
32
+ # variable so each target class/module gets its own module. This just
33
+ # a convenience to avoid prepending a lot of anonymous modules.
34
+ @__airbrake_capture_timing_module__ ||= ::Module.new
35
+ end
36
+ private :__airbrake_capture_timing_module__
37
+
38
+ # Using api private self methods so they don't get defined in the target
39
+ # class or module, but can still be called by the above method.
40
+
41
+ # @api private
42
+ def self.should_prepend?(klass, method_name)
43
+ # Don't chain already-prepended or operator methods.
44
+ klass.module_exec do
45
+ self_class_idx = ancestors.index(self)
46
+ method_owner_idx = ancestors.index(instance_method(method_name).owner)
47
+ method_owner_idx < self_class_idx || !(/\A\W/ =~ method_name).nil?
48
+ end
49
+ end
50
+
51
+ # @api private
52
+ def self.prepend_capture_timing(klass, method_name, label)
53
+ args = method_signature
54
+ visibility = method_visibility(klass, method_name)
55
+
56
+ # Generate the wrapper method.
57
+ klass.module_exec do
58
+ mod = __airbrake_capture_timing_module__
59
+ mod.module_exec do
60
+ module_eval <<-RUBY, __FILE__, __LINE__ + 1
61
+ def #{method_name}(#{args})
62
+ Airbrake::Rack.capture_timing(#{label.to_s.inspect}) do
63
+ super
64
+ end
65
+ end
66
+ #{visibility} :#{method_name}
67
+ RUBY
68
+ end
69
+ prepend mod
70
+ end
71
+ end
72
+
73
+ # @api private
74
+ def self.chain_capture_timing(klass, method_name, label)
75
+ args = method_signature
76
+ visibility = method_visibility(klass, method_name)
19
77
 
20
- define_method(method_name) do |*args|
21
- Airbrake::Rack.capture_timing(label) do
22
- __send__("#{method_name}_without_airbrake", *args)
78
+ # Generate the wrapper method.
79
+ aliased = method_name.to_s.sub(/([?!=])$/, '')
80
+ punctuation = Regexp.last_match(1)
81
+ wrapped_method_name = "#{aliased}_without_airbrake#{punctuation}"
82
+ needs_removal = method_needs_removal(klass, method_name)
83
+ klass.module_exec do
84
+ alias_method wrapped_method_name, method_name
85
+ remove_method method_name if needs_removal
86
+ module_eval <<-RUBY, __FILE__, __LINE__ + 1
87
+ def #{method_name}(#{args})
88
+ Airbrake::Rack.capture_timing(#{label.to_s.inspect}) do
89
+ __send__("#{aliased}_without_airbrake#{punctuation}", #{args})
90
+ end
91
+ end
92
+ #{visibility} :#{method_name}
93
+ RUBY
94
+ end
95
+ end
96
+
97
+ # @api private
98
+ def self.method_visibility(klass, method_name)
99
+ klass.module_exec do
100
+ if protected_method_defined?(method_name)
101
+ "protected".freeze
102
+ elsif private_method_defined?(method_name)
103
+ "private".freeze
104
+ else
105
+ "public".freeze
23
106
  end
24
107
  end
25
108
  end
109
+
110
+ # @api private
111
+ # A method instead of a constant so it isn't accessible in the target.
112
+ if Gem::Version.new(RUBY_VERSION) >= Gem::Version.new("2.7")
113
+ def self.method_signature
114
+ "*args, **kw_args, &block".freeze
115
+ end
116
+ else
117
+ def self.method_signature
118
+ "*args, &block".freeze
119
+ end
120
+ end
121
+
122
+ # @api private
123
+ if Gem::Version.new(RUBY_VERSION) >= Gem::Version.new("2.6")
124
+ def self.method_needs_removal(klass, method_name)
125
+ klass.method_defined?(method_name, false) ||
126
+ klass.private_method_defined?(method_name, false)
127
+ end
128
+ else
129
+ def self.method_needs_removal(klass, method_name)
130
+ klass.instance_methods(false).include?(method_name) ||
131
+ klass.private_instance_methods(false).include?(method_name)
132
+ end
133
+ end
26
134
  end
27
135
  end
28
136
  end
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Airbrake
2
4
  module Rack
3
5
  # Airbrake Rack middleware for Rails and Sinatra applications (or any other
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Airbrake
2
4
  module Rack
3
5
  # A filter that appends Rack request body to the notice.
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Airbrake
2
4
  module Rack
3
5
  # RequestStore is a thin (and limited) wrapper around *Thread.current* that
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'airbrake/rails/app'
2
4
 
3
5
  module Airbrake
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Airbrake
2
4
  module Rack
3
5
  # Adds HTTP session.
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Airbrake
2
4
  module Rack
3
5
  # Represents an authenticated user, which can be converted to Airbrake's
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Airbrake
2
4
  module Rack
3
5
  # Adds current user information.
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'airbrake/rails/railtie'
2
4
 
3
5
  module Airbrake
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'airbrake/rails/action_cable/notify_callback'
2
4
 
3
5
  %i[subscribe unsubscribe].each do |callback_name|
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Airbrake
2
4
  module Rails
3
5
  module ActionCable
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Airbrake
2
4
  module Rails
3
5
  # Contains helper methods that can be used inside Rails controllers to send
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'airbrake/rails/event'
2
4
 
3
5
  module Airbrake
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'airbrake/rails/event'
2
4
 
3
5
  module Airbrake
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'airbrake/rails/event'
2
4
  require 'airbrake/rails/app'
3
5
 
@@ -1,18 +1,12 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Airbrake
2
4
  module Rails
3
5
  # Enables support for exceptions occurring in ActiveJob jobs.
4
6
  module ActiveJob
5
7
  extend ActiveSupport::Concern
6
8
 
7
- # @return [Array<Regexp>] the list of known adapters
8
- ADAPTERS = [/Resque/, /Sidekiq/, /DelayedJob/].freeze
9
-
10
9
  def self.notify_airbrake(exception, job)
11
- queue_adapter = job.class.queue_adapter.to_s
12
-
13
- # Do not notify twice if a queue_adapter is configured already.
14
- raise exception if ADAPTERS.any? { |a| a =~ queue_adapter }
15
-
16
10
  notice = Airbrake.build_notice(exception)
17
11
  notice[:context][:component] = 'active_job'
18
12
  notice[:context][:action] = job.class.name
@@ -28,14 +22,14 @@ module Airbrake
28
22
  block.call
29
23
  end
30
24
  rescue StandardError => exception
31
- Airbrake.notify_queue_sync(
25
+ Airbrake.notify_queue(
32
26
  queue: job.class.name,
33
27
  error_count: 1,
34
28
  timing: 0.01,
35
29
  )
36
30
  raise exception
37
31
  else
38
- Airbrake.notify_queue_sync(
32
+ Airbrake.notify_queue(
39
33
  queue: job.class.name,
40
34
  error_count: 0,
41
35
  timing: timing,
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Airbrake
2
4
  module Rails
3
5
  # Rails <4.2 has a bug with regard to swallowing exceptions in the
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'airbrake/rails/event'
2
4
  require 'airbrake/rails/backtrace_cleaner'
3
5
 
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Airbrake
2
4
  module Rails
3
5
  # App is a wrapper around Rails.application.
@@ -24,6 +26,16 @@ module Airbrake
24
26
  # * `Marketing::Engine` recognizes it as `marketing#/pricing` (correct)
25
27
  engines.each do |engine|
26
28
  engine.routes.router.recognize(request_copy) do |route, _params|
29
+ # Skip "catch-all" routes such as:
30
+ # get '*path => 'pages#about'
31
+ #
32
+ # @todo The `glob?` method was added in Rails v4.2.0.beta1. We
33
+ # should remove the `respond_to?` check once we drop old Rails
34
+ # versions support.
35
+ #
36
+ # https://github.com/rails/rails/commit/5460591f0226a9d248b7b4f89186bd5553e7768f
37
+ next if route.respond_to?(:glob?) && route.glob?
38
+
27
39
  path =
28
40
  if engine == ::Rails.application
29
41
  route.path.spec.to_s
@@ -1,10 +1,23 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Airbrake
2
4
  module Rails
3
5
  # BacktraceCleaner is a wrapper around Rails.backtrace_cleaner.
4
6
  class BacktraceCleaner
7
+ # @return [Regexp]
8
+ AIRBRAKE_FRAME_PATTERN = %r{/airbrake/lib/airbrake/}
9
+
5
10
  def self.clean(backtrace)
6
11
  ::Rails.backtrace_cleaner.clean(backtrace).first(1)
7
12
  end
8
13
  end
9
14
  end
10
15
  end
16
+
17
+ if defined?(Rails)
18
+ # Silence own frames to let the cleaner proceed to the next line (and probably
19
+ # find the correct call-site coming from the app code rather this library).
20
+ Rails.backtrace_cleaner.add_silencer do |line|
21
+ line =~ Airbrake::Rails::BacktraceCleaner::AIRBRAKE_FRAME_PATTERN
22
+ end
23
+ end
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Curl
2
4
  # Monkey-patch to measure request timing.
3
5
  class Easy
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Airbrake
2
4
  module Rails
3
5
  # Event is a wrapper around ActiveSupport::Notifications::Event.
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'airbrake/rails/event'
2
4
 
3
5
  module Airbrake
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module HTTP
2
4
  # Monkey-patch to measure request timing.
3
5
  class Client
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  # Monkey-patch to measure request timing.
2
4
  class HTTPClient
3
5
  alias do_get_without_airbrake do_get_block
@@ -1,10 +1,18 @@
1
- # Monkey-patch Net::HTTP to benchmark it.
2
- Net::HTTP.class_eval do
3
- alias_method :request_without_airbrake, :request
1
+ # frozen_string_literal: true
4
2
 
5
- def request(request, *args, &block)
6
- Airbrake::Rack.capture_timing(:http) do
7
- request_without_airbrake(request, *args, &block)
3
+ module Airbrake
4
+ module Rails
5
+ # Monkey-patch Net::HTTP to benchmark it.
6
+ # @api private
7
+ # @since v10.0.2
8
+ module NetHttp
9
+ def request(request, *args, &block)
10
+ Airbrake::Rack.capture_timing(:http) do
11
+ super(request, *args, &block)
12
+ end
13
+ end
8
14
  end
9
15
  end
10
16
  end
17
+
18
+ Net::HTTP.prepend(Airbrake::Rails::NetHttp)
@@ -1,10 +1,14 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Airbrake
2
4
  module Rails
3
5
  # This railtie works for any Rails application that supports railties (Rails
4
6
  # 3.2+ apps). It makes Airbrake Ruby work with Rails and report errors
5
7
  # occurring in the application automatically.
8
+ #
9
+ # rubocop:disable Metrics/ClassLength, Metrics/BlockLength
6
10
  class Railtie < ::Rails::Railtie
7
- initializer('airbrake.middleware') do |app|
11
+ initializer('airbrake.middleware', after: :load_config_initializers) do |app|
8
12
  # Since Rails 3.2 the ActionDispatch::DebugExceptions middleware is
9
13
  # responsible for logging exceptions and showing a debugging page in
10
14
  # case the request is local. We want to insert our middleware after
@@ -42,7 +46,6 @@ module Airbrake
42
46
  require 'airbrake/rake/tasks'
43
47
  end
44
48
 
45
- # rubocop:disable Metrics/BlockLength
46
49
  initializer('airbrake.action_controller') do
47
50
  ActiveSupport.on_load(:action_controller, run_once: true) do
48
51
  # Patches ActionController with methods that allow us to retrieve
@@ -90,7 +93,6 @@ module Airbrake
90
93
  end
91
94
  end
92
95
  end
93
- # rubocop:enable Metrics/BlockLength
94
96
 
95
97
  initializer('airbrake.active_record') do
96
98
  ActiveSupport.on_load(:active_record, run_once: true) do
@@ -110,11 +112,21 @@ module Airbrake
110
112
  )
111
113
 
112
114
  # Filter out parameters from SQL body.
113
- Airbrake.add_performance_filter(
114
- Airbrake::Filters::SqlFilter.new(
115
- ::ActiveRecord::Base.connection_config[:adapter],
116
- ),
117
- )
115
+ if ::ActiveRecord::Base.respond_to?(:connection_db_config)
116
+ # Rails 6.1+ deprecates "connection_config" in favor of
117
+ # "connection_db_config", so we need an updated call.
118
+ Airbrake.add_performance_filter(
119
+ Airbrake::Filters::SqlFilter.new(
120
+ ::ActiveRecord::Base.connection_db_config.configuration_hash[:adapter],
121
+ ),
122
+ )
123
+ else
124
+ Airbrake.add_performance_filter(
125
+ Airbrake::Filters::SqlFilter.new(
126
+ ::ActiveRecord::Base.connection_config[:adapter],
127
+ ),
128
+ )
129
+ end
118
130
  end
119
131
  end
120
132
  end
@@ -140,5 +152,6 @@ module Airbrake
140
152
  end
141
153
  end
142
154
  end
155
+ # rubocop:enable Metrics/ClassLength, Metrics/BlockLength
143
156
  end
144
157
  end
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Typhoeus
2
4
  # Monkey-patch to measure request timing.
3
5
  class Request
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  # This is not bulletproof, but if this file is executed before a task
2
4
  # definition, we can grab tasks descriptions and locations.
3
5
  # See: https://goo.gl/ksn6PE
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'airbrake-ruby'
2
4
 
3
5
  namespace :airbrake do
@@ -97,14 +99,14 @@ namespace :airbrake do
97
99
  end
98
100
  end
99
101
 
100
- url = "https://airbrake.io/api/v3/projects/#{id}/heroku-deploys?key=#{key}"
102
+ url = ["https://airbrake.io/api/v3/projects/#{id}/heroku-deploys?key=#{key}"]
101
103
  url << "&environment=#{env}"
102
104
  url << "&repository=#{repo}" unless repo.empty?
103
105
 
104
- command = %(heroku addons:create deployhooks:http --url="#{url}")
106
+ command = [%(heroku addons:create deployhooks:http --url="#{url.join}")]
105
107
  command << " --app #{app}" if app
106
108
 
107
- puts "$ #{command}"
109
+ puts "$ #{command.join}"
108
110
  Bundler.with_clean_env { puts `#{command}` }
109
111
  end
110
112
  end
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Resque
2
4
  module Failure
3
5
  # Provides Resque integration with Airbrake.
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Airbrake
2
4
  module Shoryuken
3
5
  # Provides integration with Shoryuken.
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'airbrake/sidekiq/retryable_jobs_filter'
2
4
 
3
5
  module Airbrake
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Airbrake
2
4
  module Sidekiq
3
5
  # Filter that can ignore notices from jobs that failed but will be retried
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Airbrake
2
4
  module Sneakers
3
5
  # Provides integration with Sneakers.
@@ -10,12 +12,15 @@ module Airbrake
10
12
  # @see https://github.com/airbrake/airbrake/issues/850
11
13
  IGNORED_KEYS = %i[delivery_tag consumer channel].freeze
12
14
 
13
- def call(exception, worker = nil, **context)
15
+ # rubocop:disable Style/OptionalArguments
16
+ def call(exception, worker = nil, context)
17
+ # Later versions add a middle argument.
14
18
  Airbrake.notify(exception, filter_context(context)) do |notice|
15
19
  notice[:context][:component] = 'sneakers'
16
20
  notice[:context][:action] = worker.class.to_s
17
21
  end
18
22
  end
23
+ # rubocop:enable Style/OptionalArguments
19
24
 
20
25
  private
21
26
 
@@ -1,5 +1,7 @@
1
+ # frozen_string_literal: true
2
+
1
3
  # We use Semantic Versioning v2.0.0
2
4
  # More information: http://semver.org/
3
5
  module Airbrake
4
- AIRBRAKE_VERSION = '10.0.0'.freeze
6
+ AIRBRAKE_VERSION = '10.0.5'.freeze
5
7
  end
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  # Creates the Airbrake initializer file for Rails apps.
2
4
  #
3
5
  # @example Invokation from terminal
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  # Airbrake is an online tool that provides robust exception tracking in your Rails
2
4
  # applications. In doing so, it allows you to easily review errors, tie an error
3
5
  # to an individual piece of code, and trace the cause back to recent
@@ -52,12 +54,12 @@ Airbrake.configure do |c|
52
54
  # A list of parameters that should be filtered out of what is sent to
53
55
  # Airbrake. By default, all "password" attributes will have their contents
54
56
  # replaced.
55
- # https://github.com/airbrake/airbrake-ruby#blacklist_keys
56
- c.blacklist_keys = [/password/i, /authorization/i]
57
+ # https://github.com/airbrake/airbrake-ruby#blocklist_keys
58
+ c.blocklist_keys = [/password/i, /authorization/i]
57
59
 
58
60
  # Alternatively, you can integrate with Rails' filter_parameters.
59
61
  # Read more: https://goo.gl/gqQ1xS
60
- # c.blacklist_keys = Rails.application.config.filter_parameters
62
+ # c.blocklist_keys = Rails.application.config.filter_parameters
61
63
  end
62
64
 
63
65
  # A filter that collects request body information. Enable it if you are sure you
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: 10.0.0
4
+ version: 10.0.5
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-01-08 00:00:00.000000000 Z
11
+ date: 2020-06-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: airbrake-ruby
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: '4.12'
19
+ version: '4.13'
20
20
  type: :runtime
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: '4.12'
26
+ version: '4.13'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: rspec
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -84,16 +84,16 @@ dependencies:
84
84
  name: appraisal
85
85
  requirement: !ruby/object:Gem::Requirement
86
86
  requirements:
87
- - - "~>"
87
+ - - '='
88
88
  - !ruby/object:Gem::Version
89
- version: '2'
89
+ version: 2.2.0
90
90
  type: :development
91
91
  prerelease: false
92
92
  version_requirements: !ruby/object:Gem::Requirement
93
93
  requirements:
94
- - - "~>"
94
+ - - '='
95
95
  - !ruby/object:Gem::Version
96
- version: '2'
96
+ version: 2.2.0
97
97
  - !ruby/object:Gem::Dependency
98
98
  name: rack
99
99
  requirement: !ruby/object:Gem::Requirement
@@ -268,6 +268,20 @@ dependencies:
268
268
  - - '='
269
269
  - !ruby/object:Gem::Version
270
270
  version: 1.6.0
271
+ - !ruby/object:Gem::Dependency
272
+ name: ffi
273
+ requirement: !ruby/object:Gem::Requirement
274
+ requirements:
275
+ - - '='
276
+ - !ruby/object:Gem::Version
277
+ version: 1.12.2
278
+ type: :development
279
+ prerelease: false
280
+ version_requirements: !ruby/object:Gem::Requirement
281
+ requirements:
282
+ - - '='
283
+ - !ruby/object:Gem::Version
284
+ version: 1.12.2
271
285
  - !ruby/object:Gem::Dependency
272
286
  name: sidekiq
273
287
  requirement: !ruby/object:Gem::Requirement
@@ -435,8 +449,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
435
449
  - !ruby/object:Gem::Version
436
450
  version: '0'
437
451
  requirements: []
438
- rubyforge_project:
439
- rubygems_version: 2.7.6.2
452
+ rubygems_version: 3.1.2
440
453
  signing_key:
441
454
  specification_version: 4
442
455
  summary: Airbrake is an online tool that provides robust exception tracking in any