exception_handling 2.10.0 → 2.11.0

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: 5a517039da6b4d97a8f0715dbb7a3c989c7c63099a744c1bfe5e55d77b119948
4
- data.tar.gz: 72818ae79a8b5bad38af3e0f49e076158322a990210c4b416e57d55c33839c44
3
+ metadata.gz: 9706778bbece312eb7aa676434e2b540161c0d855990d6cb76dc0eb29f584b69
4
+ data.tar.gz: 559115f2f7ce37041563104d0addcb4d5c10d35e02f6d506f28f21c1695a2ed1
5
5
  SHA512:
6
- metadata.gz: 60015e9f53ad1a460fc735a7a78c1293cd165bebb0c7a9d6eba68c73fb6ab33dc84edf5d5e663bab6d553a9adc44ddf9f989a01352f102cd44a7eddb10a41e57
7
- data.tar.gz: 3acf7c9c0abce4c87288ddc6f6a1766c6cc98a1ee5965b467888a4838d98e5f9d0b40e92f45255279d42b4e56a5687e6af08bd1dd356a7fd21ec1aba28bf16e6
6
+ metadata.gz: a1cdbd8aa1c88bf4d3eed2f5b5aeb41c6508849b8edf370c008436d5bfa667638a0e89c239d2621fb8e3454a10b47a7cea4a96fb0ed879a51b862f2aa96c663f
7
+ data.tar.gz: b67f31bd291331e34227b4a103b1acd6bea70b757bbf75c0194cc4cb7bbc9c266bb300afc8650e135145f27eedd7d7113cb268f58a7a162966dfba52d73387ab
@@ -8,12 +8,18 @@ jobs:
8
8
  strategy:
9
9
  fail-fast: false
10
10
  matrix:
11
- ruby: [2.5, 2.6]
11
+ ruby: [2.5, 2.6, 2.7, '3.0', 3.1]
12
12
  gemfile:
13
13
  - Gemfile
14
- - gemfiles/rails_4.gemfile
15
14
  - gemfiles/rails_5.gemfile
16
15
  - gemfiles/rails_6.gemfile
16
+ exclude:
17
+ - gemfile: Gemfile
18
+ ruby: 2.5
19
+ - gemfile: gemfiles/rails_5.gemfile
20
+ ruby: '3.0'
21
+ - gemfile: gemfiles/rails_5.gemfile
22
+ ruby: 3.1
17
23
  env:
18
24
  BUNDLE_GEMFILE: ${{ matrix.gemfile }}
19
25
  steps:
@@ -21,7 +27,7 @@ jobs:
21
27
  - uses: ruby/setup-ruby@v1
22
28
  with:
23
29
  ruby-version: ${{ matrix.ruby }}
24
- bundler: 1.17.3
30
+ bundler: 2.2.29
25
31
  bundler-cache: true
26
32
  - name: Unit tests
27
33
  run: bundle exec rspec
data/.ruby-version CHANGED
@@ -1 +1 @@
1
- 2.6.5
1
+ 2.7.5
data/Appraisals CHANGED
@@ -1,11 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- appraise "rails-4" do
4
- gem 'actionmailer', '~> 4.2'
5
- gem 'actionpack', '~> 4.2'
6
- gem 'activesupport', '~> 4.2'
7
- end
8
-
9
3
  appraise "rails-5" do
10
4
  gem 'actionmailer', '~> 5.2'
11
5
  gem 'actionpack', '~> 5.2'
data/CHANGELOG.md CHANGED
@@ -4,6 +4,13 @@ Inspired by [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
4
4
 
5
5
  Note: this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
6
6
 
7
+ ## [2.11.0] - 2022-03-29
8
+ ### Added
9
+ - Added support for rails 2.7 and 3+
10
+
11
+ ### Removed
12
+ - Removed support for Rails 4
13
+
7
14
  ## [2.10.0] - 2022-03-09
8
15
  ### Removed
9
16
  - Remove custom object inspection
@@ -57,7 +64,7 @@ Note: this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0
57
64
  - In `ExceptionHandling.logger=`, implicit `logger.extend ContextualLogger::LoggerMixin` is now deprecated.
58
65
  This will be removed in version 3.0 and an `ArgumentError` will be raised if the logger
59
66
  doesn't have that mixin. Instead of this implicit behavior, you should explicitly either `extend`
60
- your logger instance or `include` that mixin into your `Logger` class.
67
+ your logger instance or `include` that mixin into your `Logger` class.
61
68
 
62
69
  ## [2.4.2] - 2020-05-11
63
70
  ### Added
data/Gemfile.lock CHANGED
@@ -1,41 +1,43 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- exception_handling (2.10.0)
5
- actionmailer (>= 4.2, < 7.0)
6
- actionpack (>= 4.2, < 7.0)
7
- activesupport (>= 4.2, < 7.0)
4
+ exception_handling (2.11.0)
5
+ actionmailer (>= 5.2, < 7.0)
6
+ actionpack (>= 5.2, < 7.0)
7
+ activesupport (>= 5.2, < 7.0)
8
8
  contextual_logger (~> 0.7)
9
9
  escalate (~> 0.3)
10
10
  eventmachine (~> 1.0)
11
11
  invoca-utils (~> 0.3)
12
+ net-smtp
13
+ psych (~> 3.0)
12
14
 
13
15
  GEM
14
16
  remote: https://rubygems.org/
15
17
  specs:
16
- actionmailer (6.0.3.5)
17
- actionpack (= 6.0.3.5)
18
- actionview (= 6.0.3.5)
19
- activejob (= 6.0.3.5)
18
+ actionmailer (6.0.4.7)
19
+ actionpack (= 6.0.4.7)
20
+ actionview (= 6.0.4.7)
21
+ activejob (= 6.0.4.7)
20
22
  mail (~> 2.5, >= 2.5.4)
21
23
  rails-dom-testing (~> 2.0)
22
- actionpack (6.0.3.5)
23
- actionview (= 6.0.3.5)
24
- activesupport (= 6.0.3.5)
24
+ actionpack (6.0.4.7)
25
+ actionview (= 6.0.4.7)
26
+ activesupport (= 6.0.4.7)
25
27
  rack (~> 2.0, >= 2.0.8)
26
28
  rack-test (>= 0.6.3)
27
29
  rails-dom-testing (~> 2.0)
28
30
  rails-html-sanitizer (~> 1.0, >= 1.2.0)
29
- actionview (6.0.3.5)
30
- activesupport (= 6.0.3.5)
31
+ actionview (6.0.4.7)
32
+ activesupport (= 6.0.4.7)
31
33
  builder (~> 3.1)
32
34
  erubi (~> 1.4)
33
35
  rails-dom-testing (~> 2.0)
34
36
  rails-html-sanitizer (~> 1.1, >= 1.2.0)
35
- activejob (6.0.3.5)
36
- activesupport (= 6.0.3.5)
37
+ activejob (6.0.4.7)
38
+ activesupport (= 6.0.4.7)
37
39
  globalid (>= 0.3.6)
38
- activesupport (6.0.3.5)
40
+ activesupport (6.0.4.7)
39
41
  concurrent-ruby (~> 1.0, >= 1.0.2)
40
42
  i18n (>= 0.7, < 2)
41
43
  minitest (~> 5.1)
@@ -49,34 +51,43 @@ GEM
49
51
  builder (3.2.4)
50
52
  byebug (11.1.3)
51
53
  coderay (1.1.2)
52
- concurrent-ruby (1.1.8)
54
+ concurrent-ruby (1.1.10)
53
55
  contextual_logger (0.11.0)
54
56
  activesupport
55
57
  json
56
58
  crass (1.0.6)
57
59
  diff-lcs (1.4.4)
60
+ digest (3.1.0)
58
61
  erubi (1.10.0)
59
62
  escalate (0.3.0)
60
63
  eventmachine (1.2.7)
61
- globalid (0.4.2)
62
- activesupport (>= 4.2.0)
64
+ globalid (1.0.0)
65
+ activesupport (>= 5.0)
63
66
  honeybadger (4.11.0)
64
- i18n (1.8.9)
67
+ i18n (1.10.0)
65
68
  concurrent-ruby (~> 1.0)
66
69
  invoca-utils (0.4.1)
70
+ io-wait (0.2.1)
67
71
  jaro_winkler (1.5.3)
68
72
  json (2.6.1)
69
- loofah (2.9.0)
73
+ loofah (2.15.0)
70
74
  crass (~> 1.0.2)
71
75
  nokogiri (>= 1.5.9)
72
76
  mail (2.7.1)
73
77
  mini_mime (>= 0.1.1)
74
78
  method_source (0.9.2)
75
- mini_mime (1.0.2)
76
- mini_portile2 (2.5.0)
77
- minitest (5.14.4)
78
- nokogiri (1.11.1)
79
- mini_portile2 (~> 2.5.0)
79
+ mini_mime (1.1.2)
80
+ mini_portile2 (2.8.0)
81
+ minitest (5.15.0)
82
+ net-protocol (0.1.2)
83
+ io-wait
84
+ timeout
85
+ net-smtp (0.3.1)
86
+ digest
87
+ net-protocol
88
+ timeout
89
+ nokogiri (1.13.3)
90
+ mini_portile2 (~> 2.8.0)
80
91
  racc (~> 1.4)
81
92
  parallel (1.17.0)
82
93
  parser (2.6.3.0)
@@ -88,14 +99,15 @@ GEM
88
99
  pry-byebug (3.8.0)
89
100
  byebug (~> 11.0)
90
101
  pry (~> 0.10)
91
- racc (1.5.2)
102
+ psych (3.3.2)
103
+ racc (1.6.0)
92
104
  rack (2.2.3)
93
105
  rack-test (1.1.0)
94
106
  rack (>= 1.0, < 3)
95
107
  rails-dom-testing (2.0.3)
96
108
  activesupport (>= 4.2.0)
97
109
  nokogiri (>= 1.6)
98
- rails-html-sanitizer (1.3.0)
110
+ rails-html-sanitizer (1.4.2)
99
111
  loofah (~> 2.3)
100
112
  rainbow (3.0.0)
101
113
  rake (13.0.1)
@@ -126,10 +138,11 @@ GEM
126
138
  power_assert
127
139
  thor (1.0.1)
128
140
  thread_safe (0.3.6)
141
+ timeout (0.2.0)
129
142
  tzinfo (1.2.9)
130
143
  thread_safe (~> 0.1)
131
144
  unicode-display_width (1.6.0)
132
- zeitwerk (2.4.2)
145
+ zeitwerk (2.5.4)
133
146
 
134
147
  PLATFORMS
135
148
  ruby
@@ -149,4 +162,4 @@ DEPENDENCIES
149
162
  test-unit
150
163
 
151
164
  BUNDLED WITH
152
- 1.17.3
165
+ 2.2.29
@@ -20,11 +20,13 @@ Gem::Specification.new do |spec|
20
20
  "allowed_push_host" => "https://rubygems.org"
21
21
  }
22
22
 
23
- spec.add_dependency 'actionmailer', '>= 4.2', '< 7.0'
24
- spec.add_dependency 'actionpack', '>= 4.2', '< 7.0'
25
- spec.add_dependency 'activesupport', '>= 4.2', '< 7.0'
23
+ spec.add_dependency 'actionmailer', '>= 5.2', '< 7.0'
24
+ spec.add_dependency 'actionpack', '>= 5.2', '< 7.0'
25
+ spec.add_dependency 'activesupport', '>= 5.2', '< 7.0'
26
26
  spec.add_dependency 'contextual_logger', '~> 0.7'
27
27
  spec.add_dependency 'escalate', '~> 0.3'
28
28
  spec.add_dependency 'eventmachine', '~> 1.0'
29
29
  spec.add_dependency 'invoca-utils', '~> 0.3'
30
+ spec.add_dependency 'psych', '~> 3.0'
31
+ spec.add_dependency 'net-smtp'
30
32
  end
@@ -5,7 +5,7 @@ source "https://rubygems.org"
5
5
  gem "actionmailer", "~> 5.2"
6
6
  gem "activesupport", "~> 5.2"
7
7
  gem "appraisal", "~> 2.2"
8
- gem "honeybadger"
8
+ gem "honeybadger", "~> 4.11"
9
9
  gem "pry"
10
10
  gem "pry-byebug"
11
11
  gem "rake"
@@ -5,7 +5,7 @@ source "https://rubygems.org"
5
5
  gem "actionmailer", "~> 6.0"
6
6
  gem "activesupport", "~> 6.0"
7
7
  gem "appraisal", "~> 2.2"
8
- gem "honeybadger"
8
+ gem "honeybadger", "~> 4.11"
9
9
  gem "pry"
10
10
  gem "pry-byebug"
11
11
  gem "rake"
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module ExceptionHandling
4
- VERSION = '2.10.0'
4
+ VERSION = '2.11.0'
5
5
  end
@@ -288,7 +288,7 @@ module ExceptionHandling # never included
288
288
  #
289
289
  # Expects passed in hash to only include keys which be directly set on the Honeybadger config
290
290
  #
291
- def enable_honeybadger(config = {})
291
+ def enable_honeybadger(**config)
292
292
  Bundler.require(:honeybadger)
293
293
  Honeybadger.configure do |config_klass|
294
294
  config.each do |k, v|
@@ -297,28 +297,28 @@ module ExceptionHandling # never included
297
297
  end
298
298
  end
299
299
 
300
- def log_warning(message, log_context = {})
300
+ def log_warning(message, **log_context)
301
301
  warning = Warning.new(message)
302
302
  warning.set_backtrace([])
303
303
  log_error(warning, **log_context)
304
304
  end
305
305
 
306
- def log_info(message, log_context = {})
306
+ def log_info(message, **log_context)
307
307
  ExceptionHandling.logger.info(message, log_context)
308
308
  end
309
309
 
310
- def log_debug(message, log_context = {})
310
+ def log_debug(message, **log_context)
311
311
  ExceptionHandling.logger.debug(message, log_context)
312
312
  end
313
313
 
314
- def ensure_safe(exception_context = "", log_context = {})
314
+ def ensure_safe(exception_context = "", **log_context)
315
315
  yield
316
316
  rescue => ex
317
317
  log_error(ex, exception_context, **log_context)
318
318
  nil
319
319
  end
320
320
 
321
- def ensure_completely_safe(exception_context = "", log_context = {})
321
+ def ensure_completely_safe(exception_context = "", **log_context)
322
322
  yield
323
323
  rescue SystemExit, SystemStackError, NoMemoryError, SecurityError, SignalException
324
324
  raise
@@ -333,29 +333,29 @@ module ExceptionHandling # never included
333
333
  escalate(email_subject, ex, last_exception_timestamp, production_support_recipients)
334
334
  end
335
335
 
336
- def escalate_error(exception_or_string, email_subject, custom_recipients = nil, log_context = {})
336
+ def escalate_error(exception_or_string, email_subject, custom_recipients = nil, **log_context)
337
337
  ex = make_exception(exception_or_string)
338
338
  log_error(ex, **log_context)
339
339
  escalate(email_subject, ex, last_exception_timestamp, custom_recipients)
340
340
  end
341
341
 
342
- def escalate_warning(message, email_subject, custom_recipients = nil, log_context = {})
342
+ def escalate_warning(message, email_subject, custom_recipients = nil, **log_context)
343
343
  ex = Warning.new(message)
344
344
  log_error(ex, **log_context)
345
345
  escalate(email_subject, ex, last_exception_timestamp, custom_recipients)
346
346
  end
347
347
 
348
- def ensure_escalation(email_subject, custom_recipients = nil, log_context = {})
348
+ def ensure_escalation(email_subject, custom_recipients = nil, **log_context)
349
349
  yield
350
350
  rescue => ex
351
- escalate_error(ex, email_subject, custom_recipients, log_context)
351
+ escalate_error(ex, email_subject, custom_recipients, **log_context)
352
352
  nil
353
353
  end
354
354
 
355
355
  deprecate :escalate_to_production_support, :escalate_error, :escalate_warning, :ensure_escalation,
356
356
  deprecator: ActiveSupport::Deprecation.new('3.0', 'ExceptionHandling')
357
357
 
358
- def alert_warning(exception_or_string, alert_name, exception_context, log_context)
358
+ def alert_warning(exception_or_string, alert_name, exception_context, **log_context)
359
359
  ex = make_exception(exception_or_string)
360
360
  log_error(ex, exception_context, **log_context)
361
361
  begin
@@ -365,10 +365,10 @@ module ExceptionHandling # never included
365
365
  end
366
366
  end
367
367
 
368
- def ensure_alert(alert_name, exception_context, log_context = {})
368
+ def ensure_alert(alert_name, exception_context, **log_context)
369
369
  yield
370
370
  rescue => ex
371
- alert_warning(ex, alert_name, exception_context, log_context)
371
+ alert_warning(ex, alert_name, exception_context, **log_context)
372
372
  nil
373
373
  end
374
374
 
@@ -385,7 +385,7 @@ module ExceptionHandling # never included
385
385
  result
386
386
  end
387
387
 
388
- def log_periodically(exception_key, interval, message, log_context = {})
388
+ def log_periodically(exception_key, interval, message, **log_context)
389
389
  self.periodic_exception_intervals ||= {}
390
390
  last_logged = self.periodic_exception_intervals[exception_key]
391
391
  if !last_logged || ((last_logged + interval) < Time.now)
@@ -158,7 +158,12 @@ describe ExceptionHandling do
158
158
 
159
159
  context "#log_warning" do
160
160
  it "have empty array as a backtrace" do
161
- expect(ExceptionHandling).to receive(:log_error).with((ExceptionHandling::Warning), anything) do |error|
161
+ expected_args = if RUBY_VERSION < '2.7'
162
+ [ExceptionHandling::Warning, anything]
163
+ else
164
+ [ExceptionHandling::Warning]
165
+ end
166
+ expect(ExceptionHandling).to receive(:log_error).with(*expected_args) do |error|
162
167
  expect(error.backtrace).to eq([])
163
168
  end
164
169
  ExceptionHandling.log_warning('Now with empty array as a backtrace!')
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: exception_handling
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.10.0
4
+ version: 2.11.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Invoca
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-03-11 00:00:00.000000000 Z
11
+ date: 2022-03-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: actionmailer
@@ -16,7 +16,7 @@ dependencies:
16
16
  requirements:
17
17
  - - ">="
18
18
  - !ruby/object:Gem::Version
19
- version: '4.2'
19
+ version: '5.2'
20
20
  - - "<"
21
21
  - !ruby/object:Gem::Version
22
22
  version: '7.0'
@@ -26,7 +26,7 @@ dependencies:
26
26
  requirements:
27
27
  - - ">="
28
28
  - !ruby/object:Gem::Version
29
- version: '4.2'
29
+ version: '5.2'
30
30
  - - "<"
31
31
  - !ruby/object:Gem::Version
32
32
  version: '7.0'
@@ -36,7 +36,7 @@ dependencies:
36
36
  requirements:
37
37
  - - ">="
38
38
  - !ruby/object:Gem::Version
39
- version: '4.2'
39
+ version: '5.2'
40
40
  - - "<"
41
41
  - !ruby/object:Gem::Version
42
42
  version: '7.0'
@@ -46,7 +46,7 @@ dependencies:
46
46
  requirements:
47
47
  - - ">="
48
48
  - !ruby/object:Gem::Version
49
- version: '4.2'
49
+ version: '5.2'
50
50
  - - "<"
51
51
  - !ruby/object:Gem::Version
52
52
  version: '7.0'
@@ -56,7 +56,7 @@ dependencies:
56
56
  requirements:
57
57
  - - ">="
58
58
  - !ruby/object:Gem::Version
59
- version: '4.2'
59
+ version: '5.2'
60
60
  - - "<"
61
61
  - !ruby/object:Gem::Version
62
62
  version: '7.0'
@@ -66,7 +66,7 @@ dependencies:
66
66
  requirements:
67
67
  - - ">="
68
68
  - !ruby/object:Gem::Version
69
- version: '4.2'
69
+ version: '5.2'
70
70
  - - "<"
71
71
  - !ruby/object:Gem::Version
72
72
  version: '7.0'
@@ -126,6 +126,34 @@ dependencies:
126
126
  - - "~>"
127
127
  - !ruby/object:Gem::Version
128
128
  version: '0.3'
129
+ - !ruby/object:Gem::Dependency
130
+ name: psych
131
+ requirement: !ruby/object:Gem::Requirement
132
+ requirements:
133
+ - - "~>"
134
+ - !ruby/object:Gem::Version
135
+ version: '3.0'
136
+ type: :runtime
137
+ prerelease: false
138
+ version_requirements: !ruby/object:Gem::Requirement
139
+ requirements:
140
+ - - "~>"
141
+ - !ruby/object:Gem::Version
142
+ version: '3.0'
143
+ - !ruby/object:Gem::Dependency
144
+ name: net-smtp
145
+ requirement: !ruby/object:Gem::Requirement
146
+ requirements:
147
+ - - ">="
148
+ - !ruby/object:Gem::Version
149
+ version: '0'
150
+ type: :runtime
151
+ prerelease: false
152
+ version_requirements: !ruby/object:Gem::Requirement
153
+ requirements:
154
+ - - ">="
155
+ - !ruby/object:Gem::Version
156
+ version: '0'
129
157
  description: Exception handling logger/emailer
130
158
  email:
131
159
  - development@invoca.com
@@ -147,7 +175,6 @@ files:
147
175
  - Rakefile
148
176
  - config/exception_filters.yml
149
177
  - exception_handling.gemspec
150
- - gemfiles/rails_4.gemfile
151
178
  - gemfiles/rails_5.gemfile
152
179
  - gemfiles/rails_6.gemfile
153
180
  - lib/exception_handling.rb
@@ -199,7 +226,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
199
226
  - !ruby/object:Gem::Version
200
227
  version: '0'
201
228
  requirements: []
202
- rubygems_version: 3.0.3
229
+ rubygems_version: 3.1.6
203
230
  signing_key:
204
231
  specification_version: 4
205
232
  summary: Invoca's exception handling logger/emailer layer, based on exception_notifier.
@@ -1,18 +0,0 @@
1
- # This file was generated by Appraisal
2
-
3
- source "https://rubygems.org"
4
-
5
- gem "actionmailer", "~> 4.2"
6
- gem "activesupport", "~> 4.2"
7
- gem "appraisal", "~> 2.2"
8
- gem "honeybadger"
9
- gem "pry"
10
- gem "pry-byebug"
11
- gem "rake"
12
- gem "rspec"
13
- gem "rspec_junit_formatter"
14
- gem "rubocop"
15
- gem "test-unit"
16
- gem "actionpack", "~> 4.2"
17
-
18
- gemspec path: "../"