logtail-rack 0.1.6 → 0.2.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: 76c8e9ab5c1364f1a345a7a20e6c24ef277ff8be9b8f3c9a173bbc9263f6d695
4
- data.tar.gz: ad6237cc17307742c7263ec59afe93e77476d7410b8e94fe4a0f32129f22565b
3
+ metadata.gz: 73931379e41a5b92e72919963376a2f6b6b8ec06871b9a410bc6c8339228387d
4
+ data.tar.gz: 01b32fd44ea670b47d5d7340a8c02c1305b203332f298818dff9ec68058e79e2
5
5
  SHA512:
6
- metadata.gz: 2d520a022a670a9a8116a0b460aa3a765d3ddcdce4598c30ace1bea5d7cc4e8494ebea7fcdaa01210eac676d7220eba6010d9cabf3f182e4edf36db0a224f00f
7
- data.tar.gz: 6fdb85a21302164570c07359a948c8a2a036ef582f0fa7a0a4078c0d7ad86d3d19d30a455709253e88c600a45e09c722e77bfdb89775247bb7308f6218bfbf50
6
+ metadata.gz: 02f9dcd2e699b1c52d9f31265bb1f77f057c8e63bab5d2e87475e7b22823a16723ef3b69e5cd99827b1d9bdf0a27db35ba7f7c3a1b7656e099a60171a0c1476d
7
+ data.tar.gz: 4e2a9cbb7b647f1ef6574ecea49db83616e7ea9082dec902c5bba980aaebc14a5cefa325ade3ed3a4d3085aba2c07610f8469b362560f94a5ef3bea6248e77f4
@@ -1,6 +1,10 @@
1
1
  name: build
2
2
 
3
- on: [push, pull_request]
3
+ on:
4
+ push:
5
+ schedule:
6
+ - cron: '20 5 * * 1'
7
+ workflow_dispatch:
4
8
 
5
9
  jobs:
6
10
  test:
@@ -8,17 +12,51 @@ jobs:
8
12
  runs-on: ubuntu-20.04
9
13
 
10
14
  strategy:
15
+ fail-fast: false
11
16
  matrix:
12
17
  ruby-version:
13
- - 3.0.0
14
- - 2.7.2
15
- - 2.6.6
16
- - 2.5.8
17
- - 2.4.10
18
- - 2.3.8
19
- - 2.2.10
18
+ - 3.2
19
+ - 3.1
20
+ - 3.0
21
+ - 2.7
22
+ - 2.6
23
+ - 2.5
24
+ - 2.4
25
+ - 2.3
26
+ - 2.2
27
+ - jruby-9.4.3.0
20
28
  - jruby-9.2.14.0
21
- - truffleruby-21.0.0
29
+ - truffleruby-23.0.0
30
+ - truffleruby-22.1.0
31
+ rack-version:
32
+ - # default Rack version
33
+
34
+ include:
35
+ - ruby-version: 2.7
36
+ rack-version: ~>1.2.0
37
+ - ruby-version: 2.7
38
+ rack-version: ~>1.2
39
+ - ruby-version: 2.7
40
+ rack-version: ~>2.0.0
41
+ - ruby-version: 2.7
42
+ rack-version: ~>2.0
43
+ - ruby-version: 2.7
44
+ rack-version: ~>3.0
45
+ - ruby-version: 2.7
46
+ rack-version: ~>3.0.0
47
+
48
+ - ruby-version: 3.2
49
+ rack-version: ~>1.2.0
50
+ - ruby-version: 3.2
51
+ rack-version: ~>1.2
52
+ - ruby-version: 3.2
53
+ rack-version: ~>2.0.0
54
+ - ruby-version: 3.2
55
+ rack-version: ~>2.0
56
+ - ruby-version: 3.2
57
+ rack-version: ~>3.0
58
+ - ruby-version: 3.2
59
+ rack-version: ~>3.0.0
22
60
 
23
61
  steps:
24
62
  - uses: actions/checkout@v2
@@ -29,5 +67,9 @@ jobs:
29
67
  ruby-version: ${{ matrix.ruby-version }}
30
68
  bundler-cache: true
31
69
 
70
+ - name: Specify "rack" gem version ${{ matrix.rack-version }}
71
+ if: ${{ matrix.rack-version }}
72
+ run: bundle add rack --version="${{ matrix.rack-version }}"
73
+
32
74
  - name: Run tests
33
75
  run: bundle exec rspec --format documentation
data/README.md CHANGED
@@ -1,6 +1,7 @@
1
1
  # 🪵 Logtail Integration For Rack
2
2
 
3
3
  [![ISC License](https://img.shields.io/badge/license-ISC-ff69b4.svg)](LICENSE.md)
4
+ [![Gem Version](https://badge.fury.io/rb/logtail-rack.svg)](https://badge.fury.io/rb/logtail-rack)
4
5
  [![Build Status](https://github.com/logtail/logtail-ruby-rack/workflows/build/badge.svg)](https://github.com/logtail/logtail-ruby-rack/actions?query=workflow%3Abuild)
5
6
 
6
7
  This library integrates the [`logtail` Ruby library](https://github.com/logtail/logtail-ruby) with the [rack](https://github.com/rack/rack) framework,
@@ -18,8 +18,9 @@ module Logtail
18
18
  request_id: request.request_id
19
19
  )
20
20
 
21
- CurrentContext.add(context.to_hash)
22
- @app.call(env)
21
+ CurrentContext.with(context.to_hash) do
22
+ @app.call(env)
23
+ end
23
24
  end
24
25
  end
25
26
  end
@@ -67,10 +67,12 @@ module Logtail
67
67
  def call(env)
68
68
  user_hash = get_user_hash(env)
69
69
  if user_hash
70
- CurrentContext.add({user: user_hash})
70
+ CurrentContext.with({user: user_hash}) do
71
+ @app.call(env)
72
+ end
73
+ else
74
+ @app.call(env)
71
75
  end
72
-
73
- @app.call(env)
74
76
  end
75
77
 
76
78
  private
@@ -1,7 +1,7 @@
1
1
  module Logtail
2
2
  module Integrations
3
3
  module Rack
4
- VERSION = "0.1.6"
4
+ VERSION = "0.2.1"
5
5
  end
6
6
  end
7
7
  end
@@ -28,7 +28,7 @@ Gem::Specification.new do |spec|
28
28
  spec.require_paths = ["lib"]
29
29
 
30
30
  spec.add_dependency "logtail", "~> 0.1"
31
- spec.add_runtime_dependency "rack", ">= 1.2", "< 3.0"
31
+ spec.add_runtime_dependency "rack", ">= 1.2", "< 4.0"
32
32
 
33
33
  spec.add_development_dependency "bundler", ">= 0.0"
34
34
  spec.add_development_dependency "rake", "~> 10.0"
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: logtail-rack
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.6
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Logtail
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2021-10-05 00:00:00.000000000 Z
11
+ date: 2023-08-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: logtail
@@ -33,7 +33,7 @@ dependencies:
33
33
  version: '1.2'
34
34
  - - "<"
35
35
  - !ruby/object:Gem::Version
36
- version: '3.0'
36
+ version: '4.0'
37
37
  type: :runtime
38
38
  prerelease: false
39
39
  version_requirements: !ruby/object:Gem::Requirement
@@ -43,7 +43,7 @@ dependencies:
43
43
  version: '1.2'
44
44
  - - "<"
45
45
  - !ruby/object:Gem::Version
46
- version: '3.0'
46
+ version: '4.0'
47
47
  - !ruby/object:Gem::Dependency
48
48
  name: bundler
49
49
  requirement: !ruby/object:Gem::Requirement
@@ -136,7 +136,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
136
136
  - !ruby/object:Gem::Version
137
137
  version: '0'
138
138
  requirements: []
139
- rubygems_version: 3.2.3
139
+ rubygems_version: 3.3.7
140
140
  signing_key:
141
141
  specification_version: 4
142
142
  summary: Logtail integration for Rack