lamian 1.8.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: 3b57232a152bc551ab708c63da1fc32bd77c38ba58b58ced8f9ea4cfa1f79f17
4
- data.tar.gz: 861029591ca765ab01f01243ea31f86af612dc8837c93e66c5c05e18730586fb
3
+ metadata.gz: '0483ed83892dd5d119ff70c1175ef0a17b659983abc2340368c7a7e84aa2834c'
4
+ data.tar.gz: 0edef13afd8a59684ca378ddd0fd9b7b8e247ac84077c0a24e059054c3c62437
5
5
  SHA512:
6
- metadata.gz: 4a886b93c920d46c84a6be2ef880b2abf3fd33e6971e81c1564d51c47530d38e6e9ddc91fe21704f46dc238776b775bf9001174f043e485095eb3e471d25b1e4
7
- data.tar.gz: 71bc11a5b32cdcd1fc69b1a4994073043c9bedd498d5db063806cb1fb70dc978b414a4583dea0517967fec1a1fec97ecc81a8dd3aafcd0ca68db2ba4f0a73114
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,19 +1,27 @@
1
- # Lamian version changes (since 0.1.0)
1
+ ## 1.10.0
2
2
 
3
- Update this on a pull request, under `Lamian::VERSION`
4
- (also known as next version). If this constant would be changed without release,
5
- I'll update it here too
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
+
7
+ ## 1.9.0
8
+
9
+ * Add `max_log_lines` config option to limit number of most recent log lines stored in the log device
6
10
 
7
11
  ## 1.8.0
12
+
8
13
  * Minor dependency updates;
9
14
 
10
15
  ## 1.3.0
16
+
11
17
  * Add support for the (new sentry gem)[https://github.com/getsentry/sentry-ruby].
12
18
 
13
19
  ## 1.2.0
20
+
14
21
  * Add `raven_log_size_limit` config option for limiting amount of data sent to sentry (defaults to `500_000`)
15
22
 
16
23
  ## 1.1.0
24
+
17
25
  * Add support for sentry and sidekiq
18
26
 
19
27
  ## 1.0.0
@@ -30,7 +38,6 @@ which ruins concept of single entry point :(. Also tied it to lamian instance
30
38
 
31
39
  * `e57e6cec` Changed rails dependency from `~> 4.2` to `>= 4.2`
32
40
 
33
-
34
41
  ## 0.3.1
35
42
 
36
43
  * 34ca83b5 Fixed formatting
@@ -38,7 +45,6 @@ which ruins concept of single entry point :(. Also tied it to lamian instance
38
45
  Stabilized formatting api, which removes control sequences from loggers data.
39
46
  E.g. `"[23mNice, lol[0m\n"` becomes `"Nice, lol\n"`
40
47
 
41
-
42
48
  ## 0.3.0
43
49
 
44
50
  * `d24f895b` API update
@@ -46,13 +52,13 @@ E.g. `"[23mNice, lol[0m\n"` becomes `"Nice, lol\n"`
46
52
  Updated API, so lamian is now forced to be used with block.
47
53
  It also simplified usage outside a middleware
48
54
 
49
-
50
55
  ## 0.2.0
56
+
51
57
  * `3166517e` Added integrtation with rails
52
58
 
53
59
  Injected middleware before `ExceptionNotification`, so `ExceptionNotification`
54
60
  can use current log without any configuration. Also added some views
55
61
 
56
-
57
62
  ## 0.1.0
63
+
58
64
  * `62eb8685` Made test version to check it's integration with rails application
data/Gemfile CHANGED
@@ -4,3 +4,17 @@ source "https://rubygems.org"
4
4
 
5
5
  # Specify your gem's dependencies in lamian.gemspec
6
6
  gemspec
7
+
8
+ gem "bundler-audit"
9
+ gem "ci-helper"
10
+ gem "launchy"
11
+ gem "pry"
12
+ gem "rake"
13
+ gem "rspec"
14
+ gem "rubocop-config-umbrellio"
15
+ gem "semantic_logger"
16
+ gem "sentry-raven"
17
+ gem "sentry-ruby"
18
+ gem "simplecov"
19
+ gem "simplecov-lcov"
20
+ gem "yard"
data/Gemfile.lock CHANGED
@@ -1,126 +1,127 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- lamian (1.8.0)
4
+ lamian (1.9.0)
5
5
  rails (>= 4.2)
6
6
 
7
7
  GEM
8
8
  remote: https://rubygems.org/
9
9
  specs:
10
- actioncable (7.1.3)
11
- actionpack (= 7.1.3)
12
- activesupport (= 7.1.3)
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)
17
- actionpack (= 7.1.3)
18
- activejob (= 7.1.3)
19
- activerecord (= 7.1.3)
20
- activestorage (= 7.1.3)
21
- activesupport (= 7.1.3)
22
- mail (>= 2.7.1)
23
- net-imap
24
- net-pop
25
- net-smtp
26
- actionmailer (7.1.3)
27
- actionpack (= 7.1.3)
28
- actionview (= 7.1.3)
29
- activejob (= 7.1.3)
30
- activesupport (= 7.1.3)
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)
37
- actionview (= 7.1.3)
38
- activesupport (= 7.1.3)
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)
47
- actionpack (= 7.1.3)
48
- activerecord (= 7.1.3)
49
- activestorage (= 7.1.3)
50
- activesupport (= 7.1.3)
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)
54
- activesupport (= 7.1.3)
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)
60
- activesupport (= 7.1.3)
54
+ activejob (7.2.0)
55
+ activesupport (= 7.2.0)
61
56
  globalid (>= 0.3.6)
62
- activemodel (7.1.3)
63
- activesupport (= 7.1.3)
64
- activerecord (7.1.3)
65
- activemodel (= 7.1.3)
66
- activesupport (= 7.1.3)
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)
69
- actionpack (= 7.1.3)
70
- activejob (= 7.1.3)
71
- activerecord (= 7.1.3)
72
- activesupport (= 7.1.3)
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)
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)
84
- addressable (2.8.1)
85
- public_suffix (>= 2.0.2, < 6.0)
78
+ securerandom (>= 0.3)
79
+ tzinfo (~> 2.0, >= 2.0.5)
80
+ addressable (2.8.7)
81
+ public_suffix (>= 2.0.2, < 7.0)
86
82
  ast (2.4.2)
87
83
  base64 (0.2.0)
88
- bigdecimal (3.1.6)
89
- builder (3.2.4)
84
+ bigdecimal (3.1.8)
85
+ builder (3.3.0)
90
86
  bundler-audit (0.9.1)
91
87
  bundler (>= 1.2.0, < 3)
92
88
  thor (~> 1.0)
93
- ci-helper (0.5.0)
94
- colorize (~> 0.8)
95
- dry-inflector (~> 0.2)
96
- umbrellio-sequel-plugins (~> 0.4)
89
+ childprocess (5.1.0)
90
+ logger (~> 1.5)
91
+ ci-helper (0.6.0)
92
+ colorize (~> 1.1)
93
+ dry-inflector (~> 1.0)
94
+ umbrellio-sequel-plugins (~> 0.14)
97
95
  coderay (1.1.3)
98
- colorize (0.8.1)
99
- concurrent-ruby (1.2.3)
96
+ colorize (1.1.0)
97
+ concurrent-ruby (1.3.4)
100
98
  connection_pool (2.4.1)
101
99
  crass (1.0.6)
102
100
  date (3.3.4)
103
- diff-lcs (1.5.0)
104
- docile (1.4.0)
105
- drb (2.2.0)
106
- ruby2_keywords
107
- dry-inflector (0.3.0)
108
- erubi (1.12.0)
109
- faraday (2.6.0)
110
- faraday-net_http (>= 2.0, < 3.1)
111
- ruby2_keywords (>= 0.0.4)
112
- faraday-net_http (3.0.1)
101
+ diff-lcs (1.5.1)
102
+ docile (1.4.1)
103
+ drb (2.2.1)
104
+ dry-inflector (1.1.0)
105
+ erubi (1.13.0)
106
+ faraday (2.10.1)
107
+ faraday-net_http (>= 2.0, < 3.2)
108
+ logger
109
+ faraday-net_http (3.1.1)
110
+ net-http
113
111
  globalid (1.2.1)
114
112
  activesupport (>= 6.1)
115
- i18n (1.14.1)
113
+ i18n (1.14.5)
116
114
  concurrent-ruby (~> 1.0)
117
115
  io-console (0.7.2)
118
- irb (1.11.1)
119
- rdoc
116
+ irb (1.14.0)
117
+ rdoc (>= 4.0.0)
120
118
  reline (>= 0.4.2)
121
- json (2.6.2)
122
- launchy (2.5.0)
123
- addressable (~> 2.7)
119
+ json (2.7.2)
120
+ language_server-protocol (3.17.0.3)
121
+ launchy (3.0.1)
122
+ addressable (~> 2.8)
123
+ childprocess (~> 5.0)
124
+ logger (1.6.0)
124
125
  loofah (2.22.0)
125
126
  crass (~> 1.0.2)
126
127
  nokogiri (>= 1.12.0)
@@ -129,61 +130,63 @@ GEM
129
130
  net-imap
130
131
  net-pop
131
132
  net-smtp
132
- marcel (1.0.2)
133
- method_source (1.0.0)
133
+ marcel (1.0.4)
134
+ method_source (1.1.0)
134
135
  mini_mime (1.1.5)
135
- mini_portile2 (2.8.5)
136
- minitest (5.21.2)
137
- mutex_m (0.2.0)
138
- net-imap (0.4.9.1)
136
+ mini_portile2 (2.8.7)
137
+ minitest (5.25.0)
138
+ net-http (0.4.1)
139
+ uri
140
+ net-imap (0.4.14)
139
141
  date
140
142
  net-protocol
141
143
  net-pop (0.1.2)
142
144
  net-protocol
143
145
  net-protocol (0.2.2)
144
146
  timeout
145
- net-smtp (0.4.0.1)
147
+ net-smtp (0.5.0)
146
148
  net-protocol
147
- nio4r (2.7.0)
148
- nokogiri (1.16.0)
149
+ nio4r (2.7.3)
150
+ nokogiri (1.16.7)
149
151
  mini_portile2 (~> 2.8.2)
150
152
  racc (~> 1.4)
151
- nokogiri (1.16.0-x86_64-darwin)
153
+ nokogiri (1.16.7-x86_64-darwin)
152
154
  racc (~> 1.4)
153
- nokogiri (1.16.0-x86_64-linux)
155
+ nokogiri (1.16.7-x86_64-linux)
154
156
  racc (~> 1.4)
155
- parallel (1.22.1)
156
- parser (3.1.2.1)
157
+ parallel (1.26.2)
158
+ parser (3.3.4.2)
157
159
  ast (~> 2.4.1)
158
- pry (0.14.1)
160
+ racc
161
+ pry (0.14.2)
159
162
  coderay (~> 1.1)
160
163
  method_source (~> 1.0)
161
164
  psych (5.1.2)
162
165
  stringio
163
- public_suffix (5.0.0)
164
- racc (1.7.3)
165
- rack (3.0.8)
166
+ public_suffix (6.0.1)
167
+ racc (1.8.1)
168
+ rack (3.1.7)
166
169
  rack-session (2.0.0)
167
170
  rack (>= 3.0.0)
168
171
  rack-test (2.1.0)
169
172
  rack (>= 1.3)
170
- rackup (2.0.0)
173
+ rackup (2.1.0)
171
174
  rack (>= 3)
172
- webrick
173
- rails (7.1.3)
174
- actioncable (= 7.1.3)
175
- actionmailbox (= 7.1.3)
176
- actionmailer (= 7.1.3)
177
- actionpack (= 7.1.3)
178
- actiontext (= 7.1.3)
179
- actionview (= 7.1.3)
180
- activejob (= 7.1.3)
181
- activemodel (= 7.1.3)
182
- activerecord (= 7.1.3)
183
- activestorage (= 7.1.3)
184
- activesupport (= 7.1.3)
175
+ webrick (~> 1.8)
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)
185
188
  bundler (>= 1.15.0)
186
- railties (= 7.1.3)
189
+ railties (= 7.2.0)
187
190
  rails-dom-testing (2.2.0)
188
191
  activesupport (>= 5.0.0)
189
192
  minitest
@@ -191,100 +194,116 @@ GEM
191
194
  rails-html-sanitizer (1.6.0)
192
195
  loofah (~> 2.21)
193
196
  nokogiri (~> 1.14)
194
- railties (7.1.3)
195
- actionpack (= 7.1.3)
196
- activesupport (= 7.1.3)
197
- irb
197
+ railties (7.2.0)
198
+ actionpack (= 7.2.0)
199
+ activesupport (= 7.2.0)
200
+ irb (~> 1.13)
198
201
  rackup (>= 1.0.0)
199
202
  rake (>= 12.2)
200
203
  thor (~> 1.0, >= 1.2.2)
201
204
  zeitwerk (~> 2.6)
202
205
  rainbow (3.1.1)
203
- rake (13.1.0)
204
- rdoc (6.6.2)
206
+ rake (13.2.1)
207
+ rdoc (6.7.0)
205
208
  psych (>= 4.0.0)
206
- regexp_parser (2.6.0)
207
- reline (0.4.2)
209
+ regexp_parser (2.9.2)
210
+ reline (0.5.9)
208
211
  io-console (~> 0.5)
209
- rexml (3.2.5)
210
- rspec (3.12.0)
211
- rspec-core (~> 3.12.0)
212
- rspec-expectations (~> 3.12.0)
213
- rspec-mocks (~> 3.12.0)
214
- rspec-core (3.12.2)
215
- rspec-support (~> 3.12.0)
216
- rspec-expectations (3.12.3)
212
+ rexml (3.3.5)
213
+ strscan
214
+ rspec (3.13.0)
215
+ rspec-core (~> 3.13.0)
216
+ rspec-expectations (~> 3.13.0)
217
+ rspec-mocks (~> 3.13.0)
218
+ rspec-core (3.13.0)
219
+ rspec-support (~> 3.13.0)
220
+ rspec-expectations (3.13.1)
217
221
  diff-lcs (>= 1.2.0, < 2.0)
218
- rspec-support (~> 3.12.0)
219
- rspec-mocks (3.12.6)
222
+ rspec-support (~> 3.13.0)
223
+ rspec-mocks (3.13.1)
220
224
  diff-lcs (>= 1.2.0, < 2.0)
221
- rspec-support (~> 3.12.0)
222
- rspec-support (3.12.1)
223
- rubocop (1.35.1)
225
+ rspec-support (~> 3.13.0)
226
+ rspec-support (3.13.1)
227
+ rubocop (1.63.5)
224
228
  json (~> 2.3)
229
+ language_server-protocol (>= 3.17.0)
225
230
  parallel (~> 1.10)
226
- parser (>= 3.1.2.1)
231
+ parser (>= 3.3.0.2)
227
232
  rainbow (>= 2.2.2, < 4.0)
228
233
  regexp_parser (>= 1.8, < 3.0)
229
234
  rexml (>= 3.2.5, < 4.0)
230
- rubocop-ast (>= 1.20.1, < 2.0)
235
+ rubocop-ast (>= 1.31.1, < 2.0)
231
236
  ruby-progressbar (~> 1.7)
232
- unicode-display_width (>= 1.4.0, < 3.0)
233
- rubocop-ast (1.23.0)
234
- parser (>= 3.1.1.0)
235
- rubocop-config-umbrellio (1.35.0.69)
236
- rubocop (~> 1.35.0)
237
- rubocop-performance (~> 1.14.0)
238
- rubocop-rails (~> 2.15.0)
237
+ unicode-display_width (>= 2.4.0, < 3.0)
238
+ rubocop-ast (1.32.0)
239
+ parser (>= 3.3.1.0)
240
+ rubocop-capybara (2.21.0)
241
+ rubocop (~> 1.41)
242
+ rubocop-config-umbrellio (1.63.0.93)
243
+ rubocop (~> 1.63.0)
244
+ rubocop-performance (~> 1.21.0)
245
+ rubocop-rails (~> 2.24.0)
239
246
  rubocop-rake (~> 0.6.0)
240
- rubocop-rspec (~> 2.12.0)
247
+ rubocop-rspec (~> 2.29.0)
241
248
  rubocop-sequel (~> 0.3.3)
242
- rubocop-performance (1.14.3)
243
- rubocop (>= 1.7.0, < 2.0)
244
- rubocop-ast (>= 0.4.0)
245
- rubocop-rails (2.15.2)
249
+ rubocop-factory_bot (2.26.1)
250
+ rubocop (~> 1.61)
251
+ rubocop-performance (1.21.1)
252
+ rubocop (>= 1.48.1, < 2.0)
253
+ rubocop-ast (>= 1.31.1, < 2.0)
254
+ rubocop-rails (2.24.1)
246
255
  activesupport (>= 4.2.0)
247
256
  rack (>= 1.1)
248
- rubocop (>= 1.7.0, < 2.0)
257
+ rubocop (>= 1.33.0, < 2.0)
258
+ rubocop-ast (>= 1.31.1, < 2.0)
249
259
  rubocop-rake (0.6.0)
250
260
  rubocop (~> 1.0)
251
- rubocop-rspec (2.12.1)
252
- rubocop (~> 1.31)
261
+ rubocop-rspec (2.29.2)
262
+ rubocop (~> 1.40)
263
+ rubocop-capybara (~> 2.17)
264
+ rubocop-factory_bot (~> 2.22)
265
+ rubocop-rspec_rails (~> 2.28)
266
+ rubocop-rspec_rails (2.29.1)
267
+ rubocop (~> 1.61)
253
268
  rubocop-sequel (0.3.4)
254
269
  rubocop (~> 1.0)
255
- ruby-progressbar (1.11.0)
256
- ruby2_keywords (0.0.5)
257
- semantic_logger (4.11.0)
270
+ ruby-progressbar (1.13.0)
271
+ securerandom (0.3.1)
272
+ semantic_logger (4.16.0)
258
273
  concurrent-ruby (~> 1.0)
259
274
  sentry-raven (3.1.2)
260
275
  faraday (>= 1.0)
261
- sentry-ruby (5.5.0)
276
+ sentry-ruby (5.19.0)
277
+ bigdecimal
262
278
  concurrent-ruby (~> 1.0, >= 1.0.2)
263
- sequel (5.61.0)
264
- simplecov (0.21.2)
279
+ sequel (5.83.1)
280
+ bigdecimal
281
+ simplecov (0.22.0)
265
282
  docile (~> 1.1)
266
283
  simplecov-html (~> 0.11)
267
284
  simplecov_json_formatter (~> 0.1)
268
285
  simplecov-html (0.12.3)
269
286
  simplecov-lcov (0.8.0)
270
287
  simplecov_json_formatter (0.1.4)
271
- stringio (3.1.0)
288
+ stringio (3.1.1)
289
+ strscan (3.1.0)
272
290
  symbiont-ruby (0.7.0)
273
- thor (1.3.0)
291
+ thor (1.3.1)
274
292
  timeout (0.4.1)
275
293
  tzinfo (2.0.6)
276
294
  concurrent-ruby (~> 1.0)
277
- umbrellio-sequel-plugins (0.10.0.86)
295
+ umbrellio-sequel-plugins (0.15.0.198)
278
296
  sequel
279
297
  symbiont-ruby
280
- unicode-display_width (2.3.0)
281
- webrick (1.7.0)
298
+ unicode-display_width (2.5.0)
299
+ uri (0.13.0)
300
+ useragent (0.16.10)
301
+ webrick (1.8.1)
282
302
  websocket-driver (0.7.6)
283
303
  websocket-extensions (>= 0.1.0)
284
304
  websocket-extensions (0.1.5)
285
- yard (0.9.28)
286
- webrick (~> 1.7.0)
287
- zeitwerk (2.6.12)
305
+ yard (0.9.36)
306
+ zeitwerk (2.6.17)
288
307
 
289
308
  PLATFORMS
290
309
  ruby
@@ -309,4 +328,4 @@ DEPENDENCIES
309
328
  yard
310
329
 
311
330
  BUNDLED WITH
312
- 2.3.24
331
+ 2.5.9
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
@@ -1,17 +1,26 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require "logger"
4
-
5
3
  module Lamian
6
4
  # General lamian configuration class
7
5
  # @attr formatter [Logger::Foramtter]
8
6
  # formatter to use in lamian, global
7
+ # @attr max_log_lines [Integer]
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, :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
21
+ self.max_log_lines = 5000
14
22
  self.raven_log_size_limit = 500_000
23
+ self.middleware_autoset = true
15
24
  end
16
25
  end
17
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
 
@@ -0,0 +1,24 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Lamian
4
+ class LogDevice # :nodoc:
5
+ def initialize(size = Lamian.config.max_log_lines)
6
+ self.size = size
7
+ self.lines = []
8
+ end
9
+
10
+ def write(string) # :nodoc:
11
+ lines << string
12
+ lines.shift if lines.size > size
13
+ true
14
+ end
15
+
16
+ def string # :nodoc:
17
+ lines.join
18
+ end
19
+
20
+ private
21
+
22
+ attr_accessor :size, :lines
23
+ end
24
+ end
data/lib/lamian/logger.rb CHANGED
@@ -23,8 +23,7 @@ module Lamian
23
23
  # @see Lamian.run
24
24
  # Collects logs sent inside block
25
25
  def run
26
- logdevs.push(StringIO.new)
27
-
26
+ logdevs.push(Lamian::LogDevice.new)
28
27
  yield
29
28
  ensure
30
29
  logdevs.pop
@@ -32,7 +31,7 @@ module Lamian
32
31
 
33
32
  # Part of Logger api, entry point for all logs
34
33
  # extened to run on each log device in stack
35
- def add(*args, &block)
34
+ def add(*args, &)
36
35
  @formatter = Lamian.config.formatter
37
36
 
38
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.8.0"
16
+ VERSION = "1.10.0"
17
17
  end
data/lib/lamian.rb CHANGED
@@ -9,6 +9,7 @@ module Lamian
9
9
  autoload :Config, "lamian/config"
10
10
  autoload :Logger, "lamian/logger"
11
11
  autoload :LoggerExtension, "lamian/logger_extension"
12
+ autoload :LogDevice, "lamian/log_device"
12
13
  autoload :Middleware, "lamian/middleware"
13
14
  autoload :RavenContextExtension, "lamian/raven_context_extension"
14
15
  autoload :SidekiqRavenMiddleware, "lamian/sidekiq_raven_middleware"
@@ -51,8 +52,8 @@ module Lamian
51
52
  end
52
53
 
53
54
  # Collects logs sent inside block
54
- def run(&block)
55
- logger.run(&block)
55
+ def run(&)
56
+ logger.run(&)
56
57
  end
57
58
 
58
59
  # Dumps log collected in this run
@@ -62,7 +63,7 @@ module Lamian
62
63
  # value given (for now)
63
64
  # @return formatted log (String by default)
64
65
  def dump(format: nil)
65
- logger.dump(format: format)
66
+ logger.dump(format:)
66
67
  end
67
68
 
68
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.8.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-01-31 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
@@ -24,188 +24,6 @@ dependencies:
24
24
  - - ">="
25
25
  - !ruby/object:Gem::Version
26
26
  version: '4.2'
27
- - !ruby/object:Gem::Dependency
28
- name: bundler-audit
29
- requirement: !ruby/object:Gem::Requirement
30
- requirements:
31
- - - ">="
32
- - !ruby/object:Gem::Version
33
- version: '0'
34
- type: :development
35
- prerelease: false
36
- version_requirements: !ruby/object:Gem::Requirement
37
- requirements:
38
- - - ">="
39
- - !ruby/object:Gem::Version
40
- version: '0'
41
- - !ruby/object:Gem::Dependency
42
- name: ci-helper
43
- requirement: !ruby/object:Gem::Requirement
44
- requirements:
45
- - - ">="
46
- - !ruby/object:Gem::Version
47
- version: '0'
48
- type: :development
49
- prerelease: false
50
- version_requirements: !ruby/object:Gem::Requirement
51
- requirements:
52
- - - ">="
53
- - !ruby/object:Gem::Version
54
- version: '0'
55
- - !ruby/object:Gem::Dependency
56
- name: launchy
57
- requirement: !ruby/object:Gem::Requirement
58
- requirements:
59
- - - ">="
60
- - !ruby/object:Gem::Version
61
- version: '0'
62
- type: :development
63
- prerelease: false
64
- version_requirements: !ruby/object:Gem::Requirement
65
- requirements:
66
- - - ">="
67
- - !ruby/object:Gem::Version
68
- version: '0'
69
- - !ruby/object:Gem::Dependency
70
- name: pry
71
- requirement: !ruby/object:Gem::Requirement
72
- requirements:
73
- - - ">="
74
- - !ruby/object:Gem::Version
75
- version: '0'
76
- type: :development
77
- prerelease: false
78
- version_requirements: !ruby/object:Gem::Requirement
79
- requirements:
80
- - - ">="
81
- - !ruby/object:Gem::Version
82
- version: '0'
83
- - !ruby/object:Gem::Dependency
84
- name: rake
85
- requirement: !ruby/object:Gem::Requirement
86
- requirements:
87
- - - ">="
88
- - !ruby/object:Gem::Version
89
- version: '0'
90
- type: :development
91
- prerelease: false
92
- version_requirements: !ruby/object:Gem::Requirement
93
- requirements:
94
- - - ">="
95
- - !ruby/object:Gem::Version
96
- version: '0'
97
- - !ruby/object:Gem::Dependency
98
- name: rspec
99
- requirement: !ruby/object:Gem::Requirement
100
- requirements:
101
- - - ">="
102
- - !ruby/object:Gem::Version
103
- version: '0'
104
- type: :development
105
- prerelease: false
106
- version_requirements: !ruby/object:Gem::Requirement
107
- requirements:
108
- - - ">="
109
- - !ruby/object:Gem::Version
110
- version: '0'
111
- - !ruby/object:Gem::Dependency
112
- name: rubocop-config-umbrellio
113
- requirement: !ruby/object:Gem::Requirement
114
- requirements:
115
- - - ">="
116
- - !ruby/object:Gem::Version
117
- version: '0'
118
- type: :development
119
- prerelease: false
120
- version_requirements: !ruby/object:Gem::Requirement
121
- requirements:
122
- - - ">="
123
- - !ruby/object:Gem::Version
124
- version: '0'
125
- - !ruby/object:Gem::Dependency
126
- name: semantic_logger
127
- requirement: !ruby/object:Gem::Requirement
128
- requirements:
129
- - - ">="
130
- - !ruby/object:Gem::Version
131
- version: '0'
132
- type: :development
133
- prerelease: false
134
- version_requirements: !ruby/object:Gem::Requirement
135
- requirements:
136
- - - ">="
137
- - !ruby/object:Gem::Version
138
- version: '0'
139
- - !ruby/object:Gem::Dependency
140
- name: sentry-raven
141
- requirement: !ruby/object:Gem::Requirement
142
- requirements:
143
- - - ">="
144
- - !ruby/object:Gem::Version
145
- version: '0'
146
- type: :development
147
- prerelease: false
148
- version_requirements: !ruby/object:Gem::Requirement
149
- requirements:
150
- - - ">="
151
- - !ruby/object:Gem::Version
152
- version: '0'
153
- - !ruby/object:Gem::Dependency
154
- name: sentry-ruby
155
- requirement: !ruby/object:Gem::Requirement
156
- requirements:
157
- - - ">="
158
- - !ruby/object:Gem::Version
159
- version: '0'
160
- type: :development
161
- prerelease: false
162
- version_requirements: !ruby/object:Gem::Requirement
163
- requirements:
164
- - - ">="
165
- - !ruby/object:Gem::Version
166
- version: '0'
167
- - !ruby/object:Gem::Dependency
168
- name: simplecov
169
- requirement: !ruby/object:Gem::Requirement
170
- requirements:
171
- - - ">="
172
- - !ruby/object:Gem::Version
173
- version: '0'
174
- type: :development
175
- prerelease: false
176
- version_requirements: !ruby/object:Gem::Requirement
177
- requirements:
178
- - - ">="
179
- - !ruby/object:Gem::Version
180
- version: '0'
181
- - !ruby/object:Gem::Dependency
182
- name: simplecov-lcov
183
- requirement: !ruby/object:Gem::Requirement
184
- requirements:
185
- - - ">="
186
- - !ruby/object:Gem::Version
187
- version: '0'
188
- type: :development
189
- prerelease: false
190
- version_requirements: !ruby/object:Gem::Requirement
191
- requirements:
192
- - - ">="
193
- - !ruby/object:Gem::Version
194
- version: '0'
195
- - !ruby/object:Gem::Dependency
196
- name: yard
197
- requirement: !ruby/object:Gem::Requirement
198
- requirements:
199
- - - ">="
200
- - !ruby/object:Gem::Version
201
- version: '0'
202
- type: :development
203
- prerelease: false
204
- version_requirements: !ruby/object:Gem::Requirement
205
- requirements:
206
- - - ">="
207
- - !ruby/object:Gem::Version
208
- version: '0'
209
27
  description: Add logs to your error messages, using exception_notifier or smth like
210
28
  it
211
29
  email:
@@ -230,6 +48,7 @@ files:
230
48
  - lib/lamian.rb
231
49
  - lib/lamian/config.rb
232
50
  - lib/lamian/engine.rb
51
+ - lib/lamian/log_device.rb
233
52
  - lib/lamian/logger.rb
234
53
  - lib/lamian/logger_extension.rb
235
54
  - lib/lamian/middleware.rb
@@ -253,7 +72,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
253
72
  requirements:
254
73
  - - ">="
255
74
  - !ruby/object:Gem::Version
256
- version: 2.7.0
75
+ version: 3.1.0
257
76
  required_rubygems_version: !ruby/object:Gem::Requirement
258
77
  requirements:
259
78
  - - ">="