nxt_support 0.3.0 → 0.4.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 +4 -4
- data/.circleci/config.yml +5 -29
- data/CHANGELOG.md +4 -0
- data/Gemfile.lock +11 -13
- data/README.md +14 -0
- data/lib/nxt_support/middleware/sentry_error_id.rb +17 -0
- data/lib/nxt_support/middleware.rb +1 -0
- data/lib/nxt_support/version.rb +1 -1
- data/lib/nxt_support.rb +1 -0
- data/nxt_support.gemspec +1 -0
- metadata +5 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8577e3b91d6cd1cea9c28349d5e481ab4f81c30198789c52caa40f13e8168532
|
4
|
+
data.tar.gz: a18e89a30f8b6b5f80ecfb87a890c47d91dc9c83e37df3c327cd0c528da6603a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2e70de03013d77d839ecd688de1328613150e8a34ed433ca31667d7bffbc9db1d1a9d79244f1aea54d96faabbcb03785f6c069a9db41a74c35638fe3d329baae
|
7
|
+
data.tar.gz: fcfab017df81cad9ef30262a95710158b7045e396f22fc11b8710ac808aa33c074c6c31a3a74bd1f64dd4a421c819aa3abbd2c238295b206fcb7e39b6bba0c74
|
data/.circleci/config.yml
CHANGED
@@ -10,7 +10,9 @@ workflows:
|
|
10
10
|
- build:
|
11
11
|
matrix:
|
12
12
|
parameters:
|
13
|
-
ruby-version: ["
|
13
|
+
ruby-version: ["3.0.2", "3.1.2"]
|
14
|
+
orbs:
|
15
|
+
ruby: circleci/ruby@2.0.0
|
14
16
|
|
15
17
|
jobs:
|
16
18
|
build:
|
@@ -20,39 +22,13 @@ jobs:
|
|
20
22
|
|
21
23
|
docker:
|
22
24
|
# specify the version you desire here
|
23
|
-
- image:
|
25
|
+
- image: cimg/ruby:<< parameters.ruby-version >>
|
24
26
|
|
25
27
|
working_directory: ~/repo
|
26
28
|
|
27
29
|
steps:
|
28
30
|
- checkout
|
29
|
-
|
30
|
-
- run:
|
31
|
-
name: Install apt dependencies
|
32
|
-
command: |
|
33
|
-
sudo apt update -q \
|
34
|
-
&& sudo apt upgrade -q \
|
35
|
-
&& sudo apt install -qy --no-install-recommends \
|
36
|
-
sqlite3 libsqlite3-dev
|
37
|
-
|
38
|
-
# Download and cache dependencies
|
39
|
-
- restore_cache:
|
40
|
-
keys:
|
41
|
-
- v1-dependencies-{{ checksum "Gemfile.lock" }}
|
42
|
-
|
43
|
-
- run: gem install bundler
|
44
|
-
|
45
|
-
- run:
|
46
|
-
name: install dependencies
|
47
|
-
command: |
|
48
|
-
bundle install --jobs=4 --retry=3 --path vendor/bundle
|
49
|
-
|
50
|
-
- save_cache:
|
51
|
-
paths:
|
52
|
-
- ./vendor/bundle
|
53
|
-
key: v1-dependencies-{{ checksum "Gemfile.lock" }}
|
54
|
-
|
55
|
-
# run tests!
|
31
|
+
- ruby/install-deps
|
56
32
|
- run:
|
57
33
|
name: run tests
|
58
34
|
command: |
|
data/CHANGELOG.md
CHANGED
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
nxt_support (0.
|
4
|
+
nxt_support (0.4.0)
|
5
5
|
activerecord
|
6
6
|
activesupport
|
7
7
|
nxt_init
|
@@ -10,24 +10,23 @@ PATH
|
|
10
10
|
GEM
|
11
11
|
remote: https://rubygems.org/
|
12
12
|
specs:
|
13
|
-
activemodel (
|
14
|
-
activesupport (=
|
15
|
-
activerecord (
|
16
|
-
activemodel (=
|
17
|
-
activesupport (=
|
18
|
-
activesupport (
|
13
|
+
activemodel (7.0.4)
|
14
|
+
activesupport (= 7.0.4)
|
15
|
+
activerecord (7.0.4)
|
16
|
+
activemodel (= 7.0.4)
|
17
|
+
activesupport (= 7.0.4)
|
18
|
+
activesupport (7.0.4)
|
19
19
|
concurrent-ruby (~> 1.0, >= 1.0.2)
|
20
20
|
i18n (>= 1.6, < 2)
|
21
21
|
minitest (>= 5.1)
|
22
22
|
tzinfo (~> 2.0)
|
23
|
-
zeitwerk (~> 2.3)
|
24
23
|
coderay (1.1.3)
|
25
|
-
concurrent-ruby (1.1.
|
24
|
+
concurrent-ruby (1.1.10)
|
26
25
|
diff-lcs (1.4.4)
|
27
|
-
i18n (1.
|
26
|
+
i18n (1.12.0)
|
28
27
|
concurrent-ruby (~> 1.0)
|
29
28
|
method_source (1.0.0)
|
30
|
-
minitest (5.
|
29
|
+
minitest (5.16.3)
|
31
30
|
nxt_init (0.1.5)
|
32
31
|
activesupport
|
33
32
|
nxt_registry (0.3.10)
|
@@ -52,9 +51,8 @@ GEM
|
|
52
51
|
rspec_junit_formatter (0.4.1)
|
53
52
|
rspec-core (>= 2, < 4, != 2.12.0)
|
54
53
|
sqlite3 (1.4.2)
|
55
|
-
tzinfo (2.0.
|
54
|
+
tzinfo (2.0.5)
|
56
55
|
concurrent-ruby (~> 1.0)
|
57
|
-
zeitwerk (2.4.2)
|
58
56
|
|
59
57
|
PLATFORMS
|
60
58
|
ruby
|
data/README.md
CHANGED
@@ -24,6 +24,20 @@ Or install it yourself as:
|
|
24
24
|
|
25
25
|
Here's an overview all the supporting features.
|
26
26
|
|
27
|
+
### NxtSupport::Middleware::SentryErrorID
|
28
|
+
A Rack middleware that adds a `Sentry-Error-ID` header to 5xx responses.
|
29
|
+
The header is only added if an error was reported during the request.
|
30
|
+
The error ID is gotten from [`sentry.error_event_id` in the Rack env](https://github.com/getsentry/sentry-ruby/pull/1849)).
|
31
|
+
You can then visit `https://sentry.io/organizations/<org-slug>>?query=<error-event-id>`
|
32
|
+
to go directly to the error (it may not show up immediately).
|
33
|
+
|
34
|
+
Note that this middleware must be inserted before Sentry's own middleware.
|
35
|
+
You can run `rails middleware` to verify the order of your registered middleware.
|
36
|
+
|
37
|
+
```rb
|
38
|
+
config.middleware.insert_before 0, NxtSupport::Middleware::SentryErrorID
|
39
|
+
```
|
40
|
+
|
27
41
|
### NxtSupport/Models
|
28
42
|
|
29
43
|
Enjoy support for your models.
|
@@ -0,0 +1,17 @@
|
|
1
|
+
module NxtSupport
|
2
|
+
module Middleware
|
3
|
+
class SentryErrorID
|
4
|
+
def initialize(app)
|
5
|
+
@app = app
|
6
|
+
end
|
7
|
+
|
8
|
+
def call(env)
|
9
|
+
status, headers, body = @app.call(env)
|
10
|
+
if status >= 500 && env['sentry.error_event_id']
|
11
|
+
headers["Sentry-Error-ID"] = env['sentry.error_event_id']
|
12
|
+
end
|
13
|
+
[status, headers, body]
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
@@ -0,0 +1 @@
|
|
1
|
+
require_relative 'middleware/sentry_error_id'
|
data/lib/nxt_support/version.rb
CHANGED
data/lib/nxt_support.rb
CHANGED
data/nxt_support.gemspec
CHANGED
@@ -26,6 +26,7 @@ Gem::Specification.new do |spec|
|
|
26
26
|
spec.bindir = "exe"
|
27
27
|
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
28
28
|
spec.require_paths = ["lib"]
|
29
|
+
spec.required_ruby_version = '>= 3.0.0'
|
29
30
|
|
30
31
|
spec.add_dependency "activerecord"
|
31
32
|
spec.add_dependency "activesupport"
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: nxt_support
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.4.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Nils Sommer
|
@@ -11,7 +11,7 @@ authors:
|
|
11
11
|
autorequire:
|
12
12
|
bindir: exe
|
13
13
|
cert_chain: []
|
14
|
-
date: 2022-
|
14
|
+
date: 2022-11-14 00:00:00.000000000 Z
|
15
15
|
dependencies:
|
16
16
|
- !ruby/object:Gem::Dependency
|
17
17
|
name: activerecord
|
@@ -165,6 +165,8 @@ files:
|
|
165
165
|
- bin/rspec
|
166
166
|
- bin/setup
|
167
167
|
- lib/nxt_support.rb
|
168
|
+
- lib/nxt_support/middleware.rb
|
169
|
+
- lib/nxt_support/middleware/sentry_error_id.rb
|
168
170
|
- lib/nxt_support/models.rb
|
169
171
|
- lib/nxt_support/models/assignable_values.rb
|
170
172
|
- lib/nxt_support/models/duration_attribute_accessor.rb
|
@@ -206,7 +208,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
206
208
|
requirements:
|
207
209
|
- - ">="
|
208
210
|
- !ruby/object:Gem::Version
|
209
|
-
version:
|
211
|
+
version: 3.0.0
|
210
212
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
211
213
|
requirements:
|
212
214
|
- - ">="
|