tobox 0.4.2 → 0.4.3
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 +4 -4
- data/CHANGELOG.md +16 -0
- data/README.md +4 -0
- data/lib/tobox/plugins/sentry.rb +19 -0
- data/lib/tobox/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2d3cc3ceebc694bccdf8ac4eb2ac340711d021ddc829b2068258cdf6554dfe1d
|
4
|
+
data.tar.gz: f6ae93dcecb775bbfe13a76f979db5bc683a4d73fa9bde8a12795b69c70f157a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 30221317cc684efda2b45d8b00e42f23906e4aa4f0eac31dd114005df200a69d6a23bea4761852c73d68c1dd2e275ab894cb8360852d2e6165c4c95318b5a733
|
7
|
+
data.tar.gz: 3f4b11296b7d023fe0befc1da20e4bc2d5b4b001fd97373eb9824c43afc94ffa9c5dcc60185f8fc567ef0ebc7e2633a3fad9e5b26c12d2db7479d84be605310f
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,21 @@
|
|
1
1
|
## [Unreleased]
|
2
2
|
|
3
|
+
## [0.4.3] - 2023-06-01
|
4
|
+
|
5
|
+
### Bugfixes
|
6
|
+
|
7
|
+
The `sentry` plugin didn't load correctly: given that app code loads before the `tobox` config, it means that, if app code runs `Sentry.init`, then the `tobox` config won't be able to fiddle anymore with it. This fixes it by making the Sentry.init call a part of the `sentry` plugin.
|
8
|
+
|
9
|
+
This means that `tobox` config now includes a new callback:
|
10
|
+
|
11
|
+
```ruby
|
12
|
+
plugin(:sentry)
|
13
|
+
on_sentry_init do |sentry_cfg|
|
14
|
+
sentry_cfg.dsn = ...
|
15
|
+
```
|
16
|
+
|
17
|
+
### Improvements
|
18
|
+
|
3
19
|
## [0.4.2] - 2023-05-25
|
4
20
|
|
5
21
|
### Improvements
|
data/README.md
CHANGED
@@ -478,6 +478,10 @@ Plugin for the [sentry](https://github.com/getsentry/sentry-ruby) ruby SDK for e
|
|
478
478
|
```ruby
|
479
479
|
# tobox.rb
|
480
480
|
plugin(:sentry)
|
481
|
+
|
482
|
+
on_sentry_init do |sentry_cfg|
|
483
|
+
sentry.dsn = ENV["SENTRY_DSN"]
|
484
|
+
end
|
481
485
|
```
|
482
486
|
|
483
487
|
<a id="markdown-datadog" name="datadog"></a>
|
data/lib/tobox/plugins/sentry.rb
CHANGED
@@ -3,6 +3,13 @@
|
|
3
3
|
module Tobox
|
4
4
|
module Plugins
|
5
5
|
module Sentry
|
6
|
+
module ConfigurationMethods
|
7
|
+
def on_sentry_init(&callback)
|
8
|
+
(@lifecycle_events[:sentry_init] ||= []) << callback
|
9
|
+
self
|
10
|
+
end
|
11
|
+
end
|
12
|
+
|
6
13
|
class Configuration
|
7
14
|
# Set this option to true if you want Sentry to only capture the last job
|
8
15
|
# retry if it fails.
|
@@ -124,6 +131,8 @@ module Tobox
|
|
124
131
|
def load_dependencies(*)
|
125
132
|
require "uri"
|
126
133
|
require "sentry-ruby"
|
134
|
+
require "sentry/integrable"
|
135
|
+
extend ::Sentry::Integrable
|
127
136
|
end
|
128
137
|
|
129
138
|
def configure(config)
|
@@ -140,6 +149,16 @@ module Tobox
|
|
140
149
|
::Sentry::Configuration.add_post_initialization_callback do
|
141
150
|
@tobox = Plugins::Sentry::Configuration.new
|
142
151
|
end
|
152
|
+
|
153
|
+
register_integration name: "tobox", version: Tobox::VERSION
|
154
|
+
|
155
|
+
config.on_start do
|
156
|
+
::Sentry.init do |sentry_cfg|
|
157
|
+
Array(config.lifecycle_events[:sentry_init]).each do |cb|
|
158
|
+
cb[sentry_cfg]
|
159
|
+
end
|
160
|
+
end
|
161
|
+
end
|
143
162
|
end
|
144
163
|
end
|
145
164
|
end
|
data/lib/tobox/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: tobox
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.4.
|
4
|
+
version: 0.4.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- HoneyryderChuck
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-
|
11
|
+
date: 2023-06-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: sequel
|