lamian 1.9.0 → 1.10.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: 881a6090b7433a7073865fad6fbf0717e1d756f654d0be3d41d4c239d396cd81
4
- data.tar.gz: 262e942fb2c73fbb80d42882d0fa9d8502df4067613ba5530f998659efe687b1
3
+ metadata.gz: '0483ed83892dd5d119ff70c1175ef0a17b659983abc2340368c7a7e84aa2834c'
4
+ data.tar.gz: 0edef13afd8a59684ca378ddd0fd9b7b8e247ac84077c0a24e059054c3c62437
5
5
  SHA512:
6
- metadata.gz: '040108c81012fb27273d2a185b7cc7c2ed4563d4881908c4c50a8c54ce160f04c97a00043a9f2f3b96c0bcf63105d7a88c3bef6b94caa2970557b1e3a0f9cf51'
7
- data.tar.gz: 6cecfa1411d0891061161577d8f60dd8052a8a6e25224c0b50f8202ba2635c6cf88aae437b4718653a257c58e9441f162c90a470c55df6f1ca8adb657467e404
6
+ metadata.gz: 79391e1eea5168c7f168c8c650eeb07dec90e1a791b276896ee29eb5cb8dbc4088670eed74f959dc075064efa79620492e28f0c3c14005d76a7bc747b1959098
7
+ data.tar.gz: 38f701100c15dc866255e710b6803ce1ae2a3cebdeaf6c9f12e9826a0d62aab3c97af933e24b7420d522a5a8403d316274e7ec53d415d02121e83441e82e1c52
@@ -44,7 +44,7 @@ jobs:
44
44
  strategy:
45
45
  fail-fast: false
46
46
  matrix:
47
- ruby: ["3.0", "3.1", "3.2"]
47
+ ruby: ["3.1", "3.2", "3.3"]
48
48
 
49
49
  steps:
50
50
  - uses: actions/checkout@v2
data/.rubocop.yml CHANGED
@@ -3,7 +3,7 @@ inherit_gem:
3
3
 
4
4
  AllCops:
5
5
  DisplayCopNames: true
6
- TargetRubyVersion: 2.7
6
+ TargetRubyVersion: 3.1
7
7
  SuggestExtensions: false
8
8
 
9
9
  RSpec/EmptyLineAfterHook:
data/Changelog.md CHANGED
@@ -1,3 +1,9 @@
1
+ ## 1.10.0
2
+
3
+ * Add an ability to insert Lamian's middleware inside the rails initialization process manually (`Lamian.config.middleware_autoset = true/false`)
4
+ * Drop EOL rubies from CI;
5
+ * Minimal Ruby version: 3.1;
6
+
1
7
  ## 1.9.0
2
8
 
3
9
  * Add `max_log_lines` config option to limit number of most recent log lines stored in the log device
data/Gemfile.lock CHANGED
@@ -7,80 +7,76 @@ PATH
7
7
  GEM
8
8
  remote: https://rubygems.org/
9
9
  specs:
10
- actioncable (7.1.3.4)
11
- actionpack (= 7.1.3.4)
12
- activesupport (= 7.1.3.4)
10
+ actioncable (7.2.0)
11
+ actionpack (= 7.2.0)
12
+ activesupport (= 7.2.0)
13
13
  nio4r (~> 2.0)
14
14
  websocket-driver (>= 0.6.1)
15
15
  zeitwerk (~> 2.6)
16
- actionmailbox (7.1.3.4)
17
- actionpack (= 7.1.3.4)
18
- activejob (= 7.1.3.4)
19
- activerecord (= 7.1.3.4)
20
- activestorage (= 7.1.3.4)
21
- activesupport (= 7.1.3.4)
22
- mail (>= 2.7.1)
23
- net-imap
24
- net-pop
25
- net-smtp
26
- actionmailer (7.1.3.4)
27
- actionpack (= 7.1.3.4)
28
- actionview (= 7.1.3.4)
29
- activejob (= 7.1.3.4)
30
- activesupport (= 7.1.3.4)
31
- mail (~> 2.5, >= 2.5.4)
32
- net-imap
33
- net-pop
34
- net-smtp
16
+ actionmailbox (7.2.0)
17
+ actionpack (= 7.2.0)
18
+ activejob (= 7.2.0)
19
+ activerecord (= 7.2.0)
20
+ activestorage (= 7.2.0)
21
+ activesupport (= 7.2.0)
22
+ mail (>= 2.8.0)
23
+ actionmailer (7.2.0)
24
+ actionpack (= 7.2.0)
25
+ actionview (= 7.2.0)
26
+ activejob (= 7.2.0)
27
+ activesupport (= 7.2.0)
28
+ mail (>= 2.8.0)
35
29
  rails-dom-testing (~> 2.2)
36
- actionpack (7.1.3.4)
37
- actionview (= 7.1.3.4)
38
- activesupport (= 7.1.3.4)
30
+ actionpack (7.2.0)
31
+ actionview (= 7.2.0)
32
+ activesupport (= 7.2.0)
39
33
  nokogiri (>= 1.8.5)
40
34
  racc
41
- rack (>= 2.2.4)
35
+ rack (>= 2.2.4, < 3.2)
42
36
  rack-session (>= 1.0.1)
43
37
  rack-test (>= 0.6.3)
44
38
  rails-dom-testing (~> 2.2)
45
39
  rails-html-sanitizer (~> 1.6)
46
- actiontext (7.1.3.4)
47
- actionpack (= 7.1.3.4)
48
- activerecord (= 7.1.3.4)
49
- activestorage (= 7.1.3.4)
50
- activesupport (= 7.1.3.4)
40
+ useragent (~> 0.16)
41
+ actiontext (7.2.0)
42
+ actionpack (= 7.2.0)
43
+ activerecord (= 7.2.0)
44
+ activestorage (= 7.2.0)
45
+ activesupport (= 7.2.0)
51
46
  globalid (>= 0.6.0)
52
47
  nokogiri (>= 1.8.5)
53
- actionview (7.1.3.4)
54
- activesupport (= 7.1.3.4)
48
+ actionview (7.2.0)
49
+ activesupport (= 7.2.0)
55
50
  builder (~> 3.1)
56
51
  erubi (~> 1.11)
57
52
  rails-dom-testing (~> 2.2)
58
53
  rails-html-sanitizer (~> 1.6)
59
- activejob (7.1.3.4)
60
- activesupport (= 7.1.3.4)
54
+ activejob (7.2.0)
55
+ activesupport (= 7.2.0)
61
56
  globalid (>= 0.3.6)
62
- activemodel (7.1.3.4)
63
- activesupport (= 7.1.3.4)
64
- activerecord (7.1.3.4)
65
- activemodel (= 7.1.3.4)
66
- activesupport (= 7.1.3.4)
57
+ activemodel (7.2.0)
58
+ activesupport (= 7.2.0)
59
+ activerecord (7.2.0)
60
+ activemodel (= 7.2.0)
61
+ activesupport (= 7.2.0)
67
62
  timeout (>= 0.4.0)
68
- activestorage (7.1.3.4)
69
- actionpack (= 7.1.3.4)
70
- activejob (= 7.1.3.4)
71
- activerecord (= 7.1.3.4)
72
- activesupport (= 7.1.3.4)
63
+ activestorage (7.2.0)
64
+ actionpack (= 7.2.0)
65
+ activejob (= 7.2.0)
66
+ activerecord (= 7.2.0)
67
+ activesupport (= 7.2.0)
73
68
  marcel (~> 1.0)
74
- activesupport (7.1.3.4)
69
+ activesupport (7.2.0)
75
70
  base64
76
71
  bigdecimal
77
- concurrent-ruby (~> 1.0, >= 1.0.2)
72
+ concurrent-ruby (~> 1.0, >= 1.3.1)
78
73
  connection_pool (>= 2.2.5)
79
74
  drb
80
75
  i18n (>= 1.6, < 2)
76
+ logger (>= 1.4.2)
81
77
  minitest (>= 5.1)
82
- mutex_m
83
- tzinfo (~> 2.0)
78
+ securerandom (>= 0.3)
79
+ tzinfo (~> 2.0, >= 2.0.5)
84
80
  addressable (2.8.7)
85
81
  public_suffix (>= 2.0.2, < 7.0)
86
82
  ast (2.4.2)
@@ -90,32 +86,34 @@ GEM
90
86
  bundler-audit (0.9.1)
91
87
  bundler (>= 1.2.0, < 3)
92
88
  thor (~> 1.0)
93
- childprocess (5.0.0)
89
+ childprocess (5.1.0)
90
+ logger (~> 1.5)
94
91
  ci-helper (0.6.0)
95
92
  colorize (~> 1.1)
96
93
  dry-inflector (~> 1.0)
97
94
  umbrellio-sequel-plugins (~> 0.14)
98
95
  coderay (1.1.3)
99
96
  colorize (1.1.0)
100
- concurrent-ruby (1.3.3)
97
+ concurrent-ruby (1.3.4)
101
98
  connection_pool (2.4.1)
102
99
  crass (1.0.6)
103
100
  date (3.3.4)
104
101
  diff-lcs (1.5.1)
105
- docile (1.4.0)
102
+ docile (1.4.1)
106
103
  drb (2.2.1)
107
- dry-inflector (1.0.0)
104
+ dry-inflector (1.1.0)
108
105
  erubi (1.13.0)
109
- faraday (2.9.2)
106
+ faraday (2.10.1)
110
107
  faraday-net_http (>= 2.0, < 3.2)
111
- faraday-net_http (3.1.0)
108
+ logger
109
+ faraday-net_http (3.1.1)
112
110
  net-http
113
111
  globalid (1.2.1)
114
112
  activesupport (>= 6.1)
115
113
  i18n (1.14.5)
116
114
  concurrent-ruby (~> 1.0)
117
115
  io-console (0.7.2)
118
- irb (1.13.2)
116
+ irb (1.14.0)
119
117
  rdoc (>= 4.0.0)
120
118
  reline (>= 0.4.2)
121
119
  json (2.7.2)
@@ -123,6 +121,7 @@ GEM
123
121
  launchy (3.0.1)
124
122
  addressable (~> 2.8)
125
123
  childprocess (~> 5.0)
124
+ logger (1.6.0)
126
125
  loofah (2.22.0)
127
126
  crass (~> 1.0.2)
128
127
  nokogiri (>= 1.12.0)
@@ -135,8 +134,7 @@ GEM
135
134
  method_source (1.1.0)
136
135
  mini_mime (1.1.5)
137
136
  mini_portile2 (2.8.7)
138
- minitest (5.24.0)
139
- mutex_m (0.2.0)
137
+ minitest (5.25.0)
140
138
  net-http (0.4.1)
141
139
  uri
142
140
  net-imap (0.4.14)
@@ -149,15 +147,15 @@ GEM
149
147
  net-smtp (0.5.0)
150
148
  net-protocol
151
149
  nio4r (2.7.3)
152
- nokogiri (1.16.6)
150
+ nokogiri (1.16.7)
153
151
  mini_portile2 (~> 2.8.2)
154
152
  racc (~> 1.4)
155
- nokogiri (1.16.6-x86_64-darwin)
153
+ nokogiri (1.16.7-x86_64-darwin)
156
154
  racc (~> 1.4)
157
- nokogiri (1.16.6-x86_64-linux)
155
+ nokogiri (1.16.7-x86_64-linux)
158
156
  racc (~> 1.4)
159
- parallel (1.25.1)
160
- parser (3.3.3.0)
157
+ parallel (1.26.2)
158
+ parser (3.3.4.2)
161
159
  ast (~> 2.4.1)
162
160
  racc
163
161
  pry (0.14.2)
@@ -165,9 +163,9 @@ GEM
165
163
  method_source (~> 1.0)
166
164
  psych (5.1.2)
167
165
  stringio
168
- public_suffix (6.0.0)
169
- racc (1.8.0)
170
- rack (3.1.4)
166
+ public_suffix (6.0.1)
167
+ racc (1.8.1)
168
+ rack (3.1.7)
171
169
  rack-session (2.0.0)
172
170
  rack (>= 3.0.0)
173
171
  rack-test (2.1.0)
@@ -175,20 +173,20 @@ GEM
175
173
  rackup (2.1.0)
176
174
  rack (>= 3)
177
175
  webrick (~> 1.8)
178
- rails (7.1.3.4)
179
- actioncable (= 7.1.3.4)
180
- actionmailbox (= 7.1.3.4)
181
- actionmailer (= 7.1.3.4)
182
- actionpack (= 7.1.3.4)
183
- actiontext (= 7.1.3.4)
184
- actionview (= 7.1.3.4)
185
- activejob (= 7.1.3.4)
186
- activemodel (= 7.1.3.4)
187
- activerecord (= 7.1.3.4)
188
- activestorage (= 7.1.3.4)
189
- activesupport (= 7.1.3.4)
176
+ rails (7.2.0)
177
+ actioncable (= 7.2.0)
178
+ actionmailbox (= 7.2.0)
179
+ actionmailer (= 7.2.0)
180
+ actionpack (= 7.2.0)
181
+ actiontext (= 7.2.0)
182
+ actionview (= 7.2.0)
183
+ activejob (= 7.2.0)
184
+ activemodel (= 7.2.0)
185
+ activerecord (= 7.2.0)
186
+ activestorage (= 7.2.0)
187
+ activesupport (= 7.2.0)
190
188
  bundler (>= 1.15.0)
191
- railties (= 7.1.3.4)
189
+ railties (= 7.2.0)
192
190
  rails-dom-testing (2.2.0)
193
191
  activesupport (>= 5.0.0)
194
192
  minitest
@@ -196,10 +194,10 @@ GEM
196
194
  rails-html-sanitizer (1.6.0)
197
195
  loofah (~> 2.21)
198
196
  nokogiri (~> 1.14)
199
- railties (7.1.3.4)
200
- actionpack (= 7.1.3.4)
201
- activesupport (= 7.1.3.4)
202
- irb
197
+ railties (7.2.0)
198
+ actionpack (= 7.2.0)
199
+ activesupport (= 7.2.0)
200
+ irb (~> 1.13)
203
201
  rackup (>= 1.0.0)
204
202
  rake (>= 12.2)
205
203
  thor (~> 1.0, >= 1.2.2)
@@ -211,7 +209,7 @@ GEM
211
209
  regexp_parser (2.9.2)
212
210
  reline (0.5.9)
213
211
  io-console (~> 0.5)
214
- rexml (3.3.1)
212
+ rexml (3.3.5)
215
213
  strscan
216
214
  rspec (3.13.0)
217
215
  rspec-core (~> 3.13.0)
@@ -237,7 +235,7 @@ GEM
237
235
  rubocop-ast (>= 1.31.1, < 2.0)
238
236
  ruby-progressbar (~> 1.7)
239
237
  unicode-display_width (>= 2.4.0, < 3.0)
240
- rubocop-ast (1.31.3)
238
+ rubocop-ast (1.32.0)
241
239
  parser (>= 3.3.1.0)
242
240
  rubocop-capybara (2.21.0)
243
241
  rubocop (~> 1.41)
@@ -270,14 +268,15 @@ GEM
270
268
  rubocop-sequel (0.3.4)
271
269
  rubocop (~> 1.0)
272
270
  ruby-progressbar (1.13.0)
273
- semantic_logger (4.15.0)
271
+ securerandom (0.3.1)
272
+ semantic_logger (4.16.0)
274
273
  concurrent-ruby (~> 1.0)
275
274
  sentry-raven (3.1.2)
276
275
  faraday (>= 1.0)
277
- sentry-ruby (5.18.0)
276
+ sentry-ruby (5.19.0)
278
277
  bigdecimal
279
278
  concurrent-ruby (~> 1.0, >= 1.0.2)
280
- sequel (5.81.0)
279
+ sequel (5.83.1)
281
280
  bigdecimal
282
281
  simplecov (0.22.0)
283
282
  docile (~> 1.1)
@@ -298,12 +297,13 @@ GEM
298
297
  symbiont-ruby
299
298
  unicode-display_width (2.5.0)
300
299
  uri (0.13.0)
300
+ useragent (0.16.10)
301
301
  webrick (1.8.1)
302
302
  websocket-driver (0.7.6)
303
303
  websocket-extensions (>= 0.1.0)
304
304
  websocket-extensions (0.1.5)
305
305
  yard (0.9.36)
306
- zeitwerk (2.6.16)
306
+ zeitwerk (2.6.17)
307
307
 
308
308
  PLATFORMS
309
309
  ruby
data/README.md CHANGED
@@ -29,6 +29,19 @@ It automatically redefines `Sentry.configuration.before_send` callback
29
29
  if Sentry initialization is completed. If `before_send` is already defined
30
30
  it wraps custom callback.
31
31
 
32
+ If you work with rails the `Lamian::Engine` will be automatically initialized, that additionally
33
+ adds `Lamian::Middleware` in the first position in your Rails Application middleware stack.
34
+
35
+ If you need to manually configure the middleware stack use `Lamian.config.middleware_autoset=false.
36
+
37
+ ```ruby
38
+ Lamian.configure do |config|
39
+ config.middleware_autoset = false
40
+ end
41
+
42
+ Rails.configuration.middleware.use_after(YourSignificantMiddlewareInStack, Lamian::Middleware)
43
+ ```
44
+
32
45
  ### Usage with Sidekiq
33
46
 
34
47
  You should add Lamian middleware to the Sidekiq initializer like this:
data/lib/lamian/config.rb CHANGED
@@ -8,11 +8,19 @@ module Lamian
8
8
  # max number of most recent log lines to store, defaults to 5000
9
9
  # @attr raven_log_size_limit [Integer]
10
10
  # size limit when sending lamian log to sentry, defaults to +500_000+
11
- Config = Struct.new(:formatter, :max_log_lines, :raven_log_size_limit) do
11
+ # @attr middleware_autoset [BOolean]
12
+ # automatically setup a middleware module during rails initialization process
13
+ Config = Struct.new(
14
+ :formatter,
15
+ :max_log_lines,
16
+ :raven_log_size_limit,
17
+ :middleware_autoset,
18
+ ) do
12
19
  def initialize
13
20
  self.formatter = ::Logger::Formatter.new
14
21
  self.max_log_lines = 5000
15
22
  self.raven_log_size_limit = 500_000
23
+ self.middleware_autoset = true
16
24
  end
17
25
  end
18
26
  end
data/lib/lamian/engine.rb CHANGED
@@ -11,7 +11,9 @@ module Lamian
11
11
 
12
12
  initializer "lamian.use_rack_middleware" do |app|
13
13
  # :nocov:
14
- app.config.middleware.unshift(Lamian::Middleware)
14
+ if Lamian.config.middleware_autoset
15
+ app.config.middleware.unshift(Lamian::Middleware)
16
+ end
15
17
  # :nocov:
16
18
  end
17
19
 
data/lib/lamian/logger.rb CHANGED
@@ -31,7 +31,7 @@ module Lamian
31
31
 
32
32
  # Part of Logger api, entry point for all logs
33
33
  # extened to run on each log device in stack
34
- def add(*args, &block)
34
+ def add(*args, &)
35
35
  @formatter = Lamian.config.formatter
36
36
 
37
37
  logdevs.each do |logdev|
@@ -13,5 +13,5 @@ module Lamian
13
13
  # According to this, it is enough to specify '~> a.b'
14
14
  # if private API was not used and to specify '~> a.b.c' if it was
15
15
 
16
- VERSION = "1.9.0"
16
+ VERSION = "1.10.0"
17
17
  end
data/lib/lamian.rb CHANGED
@@ -52,8 +52,8 @@ module Lamian
52
52
  end
53
53
 
54
54
  # Collects logs sent inside block
55
- def run(&block)
56
- logger.run(&block)
55
+ def run(&)
56
+ logger.run(&)
57
57
  end
58
58
 
59
59
  # Dumps log collected in this run
@@ -63,7 +63,7 @@ module Lamian
63
63
  # value given (for now)
64
64
  # @return formatted log (String by default)
65
65
  def dump(format: nil)
66
- logger.dump(format: format)
66
+ logger.dump(format:)
67
67
  end
68
68
 
69
69
  # Truncates the collected log to the specified limit and dumps it.
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: lamian
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.9.0
4
+ version: 1.10.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - JelF
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-06-28 00:00:00.000000000 Z
11
+ date: 2024-08-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -72,14 +72,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
72
72
  requirements:
73
73
  - - ">="
74
74
  - !ruby/object:Gem::Version
75
- version: 2.7.0
75
+ version: 3.1.0
76
76
  required_rubygems_version: !ruby/object:Gem::Requirement
77
77
  requirements:
78
78
  - - ">="
79
79
  - !ruby/object:Gem::Version
80
80
  version: '0'
81
81
  requirements: []
82
- rubygems_version: 3.5.11
82
+ rubygems_version: 3.5.3
83
83
  signing_key:
84
84
  specification_version: 4
85
85
  summary: Add logs to your error messages