honeybadger 5.8.0 → 5.9.0

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 93eae2a3397ecc7b7bc1b86b2a09436cc41e80d6143aa813175aafbc4ef81d64
4
- data.tar.gz: f2f9025c4fd6f7afc092ba4ce12cf22f0815bea6b0d32e6566f95c52c98be8b9
3
+ metadata.gz: 2c74b0590c5e22b6e264874c05c3dcc6a05159d9fe9daa119222c3fada7610da
4
+ data.tar.gz: acce276df177dc0c91c15a216c65f9ecd78e9d1221d5f4d39bb1c95bbee4f509
5
5
  SHA512:
6
- metadata.gz: ebda94d56e7c4062d3daab6d7ee19828d8a183a7d6caa33a7bef18fcc091bf1cc0b3b60708a50d0da978ec3411d6a27532bb559fb117302312d5c83f5cac4eeb
7
- data.tar.gz: d693bae2da5c6434df5ce6b0c1ab885f8f89390c0c9849e16a4a0e937685426f18be24947ff52e1f5b8176b9395262315d67b3500e6323e2211c3bc30743d7c4
6
+ metadata.gz: bcac64eba99e9cad7d31d59d31643080b6725f6e32ee9454e8f4ffb7fc354a6b10b03433ca5469d280c6afca7b6d4df0e7c2aaa5edc858124a416c22d3e52da8
7
+ data.tar.gz: 7bfe5cfde348795b66d3fe97ff9e4c7bbe41d1b1fd273b39524d1a225dfebd6dcc62c1dae563fb95c5535362e1f9dbe8f08c8798de516941e433a440258449d3
data/CHANGELOG.md CHANGED
@@ -1,6 +1,20 @@
1
1
  # Change Log
2
2
 
3
3
 
4
+ ## [5.9.0](https://github.com/honeybadger-io/honeybadger-ruby/compare/v5.8.1...v5.9.0) (2024-05-09)
5
+
6
+
7
+ ### Features
8
+
9
+ * implement local contexts ([#541](https://github.com/honeybadger-io/honeybadger-ruby/issues/541)) ([806718e](https://github.com/honeybadger-io/honeybadger-ruby/commit/806718e76bf8d132a632c75bea124a8b22a4cc97))
10
+
11
+ ## [5.8.1](https://github.com/honeybadger-io/honeybadger-ruby/compare/v5.8.0...v5.8.1) (2024-05-07)
12
+
13
+
14
+ ### Bug Fixes
15
+
16
+ * store pr title before usage ([#542](https://github.com/honeybadger-io/honeybadger-ruby/issues/542)) ([d4cdfe7](https://github.com/honeybadger-io/honeybadger-ruby/commit/d4cdfe71d6a957be8c61bcb5c01f96b0735b5c97))
17
+
4
18
  ## [5.8.0](https://github.com/honeybadger-io/honeybadger-ruby/compare/v5.7.0...v5.8.0) (2024-03-23)
5
19
 
6
20
 
@@ -259,8 +259,8 @@ module Honeybadger
259
259
  # (optional).
260
260
  #
261
261
  # @return [self] so that method calls can be chained.
262
- def context(context = nil)
263
- context_manager.set_context(context) unless context.nil?
262
+ def context(context = nil, &block)
263
+ context_manager.set_context(context, &block) unless context.nil?
264
264
  self
265
265
  end
266
266
 
@@ -59,7 +59,7 @@ MSG
59
59
  api_key: config.get(:api_key),
60
60
  notifier: NOTIFIER,
61
61
  error: {
62
- class: 'honeybdager exec error',
62
+ class: 'honeybadger exec error',
63
63
  message: result.msg
64
64
  },
65
65
  request: {
@@ -21,15 +21,36 @@ module Honeybadger
21
21
  # Internal helpers
22
22
 
23
23
 
24
- def set_context(hash)
24
+ def set_context(hash, &block)
25
+ local = block_given?
25
26
  @mutex.synchronize do
26
- @context ||= {}
27
- @context.update(Context(hash))
27
+ @global_context ||= {}
28
+ @local_context ||= []
29
+
30
+ new_context = Context(hash)
31
+
32
+ if local
33
+ @local_context << new_context
34
+ else
35
+ @global_context.update(new_context)
36
+ end
37
+ end
38
+
39
+ if local
40
+ begin
41
+ yield
42
+ ensure
43
+ @mutex.synchronize { @local_context&.pop }
44
+ end
28
45
  end
29
46
  end
30
47
 
31
48
  def get_context
32
- @mutex.synchronize { @context }
49
+ @mutex.synchronize do
50
+ return @global_context unless @local_context
51
+
52
+ @global_context.merge(@local_context.inject({}, :merge))
53
+ end
33
54
  end
34
55
 
35
56
  def set_rack_env(env)
@@ -46,10 +67,10 @@ module Honeybadger
46
67
 
47
68
  def _initialize
48
69
  @mutex.synchronize do
49
- @context = nil
70
+ @global_context = nil
71
+ @local_context = nil
50
72
  @rack_env = nil
51
73
  end
52
74
  end
53
-
54
75
  end
55
76
  end
@@ -1,4 +1,4 @@
1
1
  module Honeybadger
2
2
  # The current String Honeybadger version.
3
- VERSION = '5.8.0'.freeze
3
+ VERSION = '5.9.0'.freeze
4
4
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: honeybadger
3
3
  version: !ruby/object:Gem::Version
4
- version: 5.8.0
4
+ version: 5.9.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Honeybadger Industries LLC
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-03-23 00:00:00.000000000 Z
11
+ date: 2024-05-09 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: Make managing application errors a more pleasant experience.
14
14
  email:
@@ -144,7 +144,7 @@ metadata:
144
144
  documentation_uri: https://docs.honeybadger.io/lib/ruby/
145
145
  homepage_uri: https://www.honeybadger.io/for/ruby/
146
146
  source_code_uri: https://github.com/honeybadger-io/honeybadger-ruby
147
- post_install_message:
147
+ post_install_message:
148
148
  rdoc_options:
149
149
  - "--markup=tomdoc"
150
150
  - "--main=README.md"
@@ -163,7 +163,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
163
163
  version: '0'
164
164
  requirements: []
165
165
  rubygems_version: 3.5.3
166
- signing_key:
166
+ signing_key:
167
167
  specification_version: 4
168
168
  summary: Error reports you can be happy about.
169
169
  test_files: []