rollbar 3.5.2 → 3.6.1

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: a0a67fdd109dbc4ad80b42d5fee83b86d4c238f173e36f21fcccd7824309bf4a
4
- data.tar.gz: ddada3a7d29b64307fa73e45a430d43ae8ee470dae670e15b5994da69fddd601
3
+ metadata.gz: 31f15586920ecb703867f190757c35491671f3391ed2b9c02f281809f71b10f4
4
+ data.tar.gz: c96de5c4519b77662362395c4a50750fc25803fc10fbde5eecfebda6fefe6688
5
5
  SHA512:
6
- metadata.gz: 682314257603690332897347973e469f72efe8d320480a906e2ea73da3f3a22dd37f5af254c329a0484cc7327d17caa24e69bf0b3381a2ebb73d4c22413a98ad
7
- data.tar.gz: c7d766e933113335f15bc0622bfbf8183e41110531d3cc76ead5aa786f7be7ed19d472dd5855de56110970c4871519d3a2dc9067e5a4c25cdf02009f1303495f
6
+ metadata.gz: 3dc7101d46b693662e8cd1ecce2408176f13f8a770eb4d2af3ff984041728c6158f18c1b362a3c096b95384c6c6493e014d2c6196048b3cb433710c34b579d77
7
+ data.tar.gz: 9440cb71e6cad634faa99e4ea2bdce6f2eba5b0169920c61e17d4c5cbc17eae8e9b9da45113d79cdb943ea842613fa4f3259f8150977bf2373d35586b91fc8ad
data/.rubocop.yml CHANGED
@@ -65,9 +65,9 @@ Style/FrozenStringLiteralComment:
65
65
  Enabled: false
66
66
 
67
67
  Style/HashSyntax:
68
- EnforcedStyle: hash_rockets
68
+ EnforcedStyle: no_mixed_keys
69
69
  SupportedStyles:
70
- - hash_rockets
70
+ - no_mixed_keys
71
71
 
72
72
  Style/Lambda:
73
73
  Enabled: false
@@ -156,8 +156,6 @@ Performance/InefficientHashSearch:
156
156
 
157
157
  Performance/OpenStruct:
158
158
  Enabled: true
159
- Exclude:
160
- - spec/**/*
161
159
 
162
160
  Performance/RangeInclude:
163
161
  Enabled: true
data/Gemfile CHANGED
@@ -27,6 +27,10 @@ else
27
27
  gem 'rspec-rails', '~> 6.0.3'
28
28
  end
29
29
 
30
+ if GEMFILE_RAILS_VERSION < '7.1'
31
+ gem 'concurrent-ruby', '1.3.4'
32
+ end
33
+
30
34
  if GEMFILE_RAILS_VERSION < '6.0'
31
35
  gem 'sqlite3', '< 1.4.0', :platform => [:ruby, :mswin, :mingw]
32
36
  else
@@ -34,13 +34,15 @@ gem 'sucker_punch', '~> 2.0'
34
34
 
35
35
  gem 'rack', '2.1.2' if Gem::Version.new(RUBY_VERSION) < Gem::Version.new('2.3')
36
36
 
37
- # We need last sinatra that uses rack 2.1.x
37
+ gem 'concurrent-ruby', '1.3.4'
38
38
  gem 'database_cleaner', '~> 1.8.4'
39
39
  gem 'delayed_job', :require => false
40
40
  gem 'generator_spec'
41
41
  gem 'redis', '<= 3.3.5'
42
42
  gem 'resque'
43
43
  gem 'secure_headers', '~> 6.3.2', :require => false
44
+
45
+ # We need last sinatra that uses rack 2.1.x
44
46
  gem 'sinatra', :git => 'https://github.com/sinatra/sinatra', :tag => 'v2.0.8'
45
47
 
46
48
  unless is_jruby
@@ -37,6 +37,7 @@ gem 'rack', '2.1.2' if Gem::Version.new(RUBY_VERSION) < Gem::Version.new('2.3')
37
37
  # We need last sinatra that uses rack 2.1.x
38
38
  gem 'sinatra', :git => 'https://github.com/sinatra/sinatra', :tag => 'v2.0.8'
39
39
 
40
+ gem 'concurrent-ruby', '1.3.4'
40
41
  gem 'database_cleaner', '~> 1.8.4'
41
42
  gem 'delayed_job', :require => false
42
43
  gem 'generator_spec'
@@ -31,6 +31,7 @@ gem 'sucker_punch', '~> 2.0'
31
31
  # We need last sinatra that uses rack 2.x and ruby 2.5.x
32
32
  gem 'sinatra', :git => 'https://github.com/sinatra/sinatra', :tag =>'v2.1.0'
33
33
 
34
+ gem 'concurrent-ruby', '1.3.4'
34
35
  gem 'database_cleaner'
35
36
  gem 'delayed_job', :require => false
36
37
  gem 'generator_spec'
@@ -27,6 +27,7 @@ gem 'sucker_punch', '~> 2.0'
27
27
  # We need last sinatra that uses rack 2.x and ruby 2.5.x
28
28
  gem 'sinatra', :git => 'https://github.com/sinatra/sinatra', :tag =>'v2.1.0'
29
29
 
30
+ gem 'concurrent-ruby', '1.3.4'
30
31
  gem 'database_cleaner'
31
32
  gem 'delayed_job', '4.1.9', :require => false
32
33
  gem 'generator_spec'
@@ -27,6 +27,7 @@ gem 'sucker_punch', '~> 2.0'
27
27
  # We need last sinatra that uses rack 2.x and ruby 2.5.x
28
28
  gem 'sinatra', :git => 'https://github.com/sinatra/sinatra', :tag =>'v2.1.0'
29
29
 
30
+ gem 'concurrent-ruby', '1.3.4'
30
31
  gem 'database_cleaner'
31
32
  gem 'delayed_job', '4.1.9', :require => false
32
33
  gem 'generator_spec'
@@ -27,6 +27,7 @@ gem 'sucker_punch', '~> 2.0'
27
27
  # We need last sinatra that uses rack 2.x and ruby 2.5.x
28
28
  gem 'sinatra', :git => 'https://github.com/sinatra/sinatra', :tag =>'v2.1.0'
29
29
 
30
+ gem 'concurrent-ruby', '1.3.4'
30
31
  gem 'database_cleaner'
31
32
  gem 'delayed_job', '4.1.10', :require => false
32
33
  gem 'generator_spec'
@@ -76,6 +76,7 @@ module Rollbar
76
76
  :web_base,
77
77
  :write_to_file
78
78
  attr_reader :before_process,
79
+ :enable_rails_error_subscriber,
79
80
  :logger_level,
80
81
  :project_gem_paths,
81
82
  :send_extra_frame_data,
@@ -104,6 +105,7 @@ module Rollbar
104
105
  @disable_core_monkey_patch = false
105
106
  @disable_rack_monkey_patch = false
106
107
  @enable_error_context = true
108
+ @enable_rails_error_subscriber = false
107
109
  @dj_threshold = 0
108
110
  @dj_use_scoped_block = false
109
111
  @async_skip_report_handler = nil
@@ -337,6 +339,20 @@ module Rollbar
337
339
  @send_extra_frame_data = value
338
340
  end
339
341
 
342
+ def enable_rails_error_subscriber=(enable)
343
+ return if !defined?(::Rails) || ::Rails.gem_version < ::Gem::Version.new('7.1.0')
344
+
345
+ if @enable_rails_error_subscriber && !enable
346
+ ::Rails.error.unsubscribe(Rollbar::ErrorSubscriber)
347
+ end
348
+
349
+ if !@enable_rails_error_subscriber && enable
350
+ ::Rails.error.subscribe(Rollbar::ErrorSubscriber.new)
351
+ end
352
+
353
+ @enable_rails_error_subscriber = enable
354
+ end
355
+
340
356
  # allow params to be read like a hash
341
357
  def [](option)
342
358
  send(option)
@@ -27,7 +27,8 @@ module Rollbar
27
27
  end
28
28
 
29
29
  def capture_uncaught?
30
- Rollbar.configuration.capture_uncaught != false
30
+ Rollbar.configuration.capture_uncaught != false &&
31
+ !Rollbar.configuration.enable_rails_error_subscriber
31
32
  end
32
33
 
33
34
  def log_exception_message(exception)
@@ -17,12 +17,10 @@ module Rollbar
17
17
  class Logger < ::Logger
18
18
  class Error < RuntimeError; end
19
19
 
20
- class DatetimeFormatNotSupported < Error; end
21
-
22
- class FormatterNotSupported < Error; end
23
-
24
20
  def initialize
25
- @level = ERROR
21
+ super(nil)
22
+
23
+ self.level = ERROR
26
24
  end
27
25
 
28
26
  def add(severity, message = nil, progname = nil)
@@ -39,22 +37,6 @@ module Rollbar
39
37
  error(message)
40
38
  end
41
39
 
42
- def formatter=(_)
43
- raise(FormatterNotSupported)
44
- end
45
-
46
- def formatter
47
- raise(FormatterNotSupported)
48
- end
49
-
50
- def datetime_format=(_)
51
- raise(DatetimeFormatNotSupported)
52
- end
53
-
54
- def datetime_format
55
- raise(DatetimeFormatNotSupported)
56
- end
57
-
58
40
  # Returns a Rollbar::Notifier instance with the current global scope and
59
41
  # with a logger writing to /dev/null so we don't have a infinite loop
60
42
  # when Rollbar.configuration.logger is Rails.logger.
@@ -9,7 +9,6 @@ require 'rollbar/delay/thread'
9
9
  require 'rollbar/logger_proxy'
10
10
  require 'rollbar/item'
11
11
  require 'rollbar/notifier/trace_with_bindings'
12
- require 'ostruct'
13
12
 
14
13
  module Rollbar
15
14
  # The notifier class. It has the core functionality
@@ -0,0 +1,12 @@
1
+ module Rollbar
2
+ class ErrorSubscriber
3
+ def report(error, handled:, severity:, context:, source: nil)
4
+ # The default `nil` for capture_uncaught means `true`. so check for false.
5
+ return unless handled || Rollbar.configuration.capture_uncaught != false
6
+
7
+ extra = context.is_a?(Hash) ? context.deep_dup : {}
8
+ extra[:custom_data_method_context] = source
9
+ Rollbar.log(severity, error, extra)
10
+ end
11
+ end
12
+ end
@@ -79,3 +79,11 @@ Rollbar.plugins.define('rails-rollbar.js') do
79
79
  Rollbar::Js::Frameworks::Rails.new.load(self)
80
80
  end
81
81
  end
82
+
83
+ Rollbar.plugins.define('rails-error-subscriber') do
84
+ dependency { defined?(Rails::VERSION) && Rails::VERSION::MAJOR >= 7 }
85
+
86
+ execute! do
87
+ require 'rollbar/plugins/rails/error_subscriber'
88
+ end
89
+ end
@@ -1,3 +1,3 @@
1
1
  module Rollbar
2
- VERSION = '3.5.2'.freeze
2
+ VERSION = '3.6.1'.freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rollbar
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.5.2
4
+ version: 3.6.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Rollbar, Inc.
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-02-20 00:00:00.000000000 Z
11
+ date: 2025-02-07 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: Track and debug errors in your Ruby applications with ease using Rollbar.
14
14
  With this gem, you can easily monitor and report on exceptions and other errors
@@ -101,6 +101,7 @@ files:
101
101
  - lib/rollbar/plugins/rack.rb
102
102
  - lib/rollbar/plugins/rails.rb
103
103
  - lib/rollbar/plugins/rails/controller_methods.rb
104
+ - lib/rollbar/plugins/rails/error_subscriber.rb
104
105
  - lib/rollbar/plugins/rails/railtie30.rb
105
106
  - lib/rollbar/plugins/rails/railtie32.rb
106
107
  - lib/rollbar/plugins/rails/railtie_mixin.rb