getaround_utils 0.2.26 → 0.2.28
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +43 -23
- data/getaround_utils.gemspec +5 -2
- data/lib/getaround_utils/engines/health.rb +69 -0
- data/lib/getaround_utils/engines.rb +3 -0
- data/lib/getaround_utils/railties/lograge.rb +1 -0
- data/lib/getaround_utils/version.rb +1 -1
- data/lib/getaround_utils.rb +1 -0
- metadata +25 -9
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4fca4e13fd9ea2df3a55952ab08aec5971b58269633125efc8009a8b94dde519
|
4
|
+
data.tar.gz: e5d39a9f05c9698f5da85329b7e74212384258ae1f6dfc9feeddeae646835a63
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a6d419a987df9fab2beee07f6c30856a10a10ba3500b4eb0689f28eb98df912a7c131ba02fdf81b5cf8b4510c7f307a87569f712216cc5cbe735fb13402a060d
|
7
|
+
data.tar.gz: 6bc8d044bd8ce138da2dd4d6d241a1aac8c0437695d49bfd480a1dff6e6dbca6e4774904abe2a15e5be2028d700d21d7538f6684a56095e228933a19d6c2e77d
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,8 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
getaround_utils (0.2.
|
4
|
+
getaround_utils (0.2.28)
|
5
|
+
rack (~> 2.0)
|
5
6
|
|
6
7
|
GEM
|
7
8
|
remote: https://rubygems.org/
|
@@ -81,15 +82,19 @@ GEM
|
|
81
82
|
dotenv (= 2.8.1)
|
82
83
|
railties (>= 3.2)
|
83
84
|
erubi (1.12.0)
|
84
|
-
getaround-rubocop (0.2.
|
85
|
+
getaround-rubocop (0.2.8)
|
85
86
|
relaxed-rubocop (= 2.5)
|
86
|
-
rubocop (= 1.
|
87
|
-
rubocop-
|
87
|
+
rubocop (= 1.55.0)
|
88
|
+
rubocop-performance (= 1.18.0)
|
89
|
+
rubocop-rails (= 2.20.2)
|
90
|
+
rubocop-rspec (= 2.23.0)
|
88
91
|
globalid (1.1.0)
|
89
92
|
activesupport (>= 5.0)
|
90
93
|
hashdiff (1.0.1)
|
91
94
|
i18n (1.14.1)
|
92
95
|
concurrent-ruby (~> 1.0)
|
96
|
+
json (2.6.3)
|
97
|
+
language_server-protocol (3.17.0.3)
|
93
98
|
lograge (0.13.0)
|
94
99
|
actionpack (>= 4)
|
95
100
|
activesupport (>= 4)
|
@@ -112,9 +117,10 @@ GEM
|
|
112
117
|
oj (3.11.3)
|
113
118
|
ougai (2.0.0)
|
114
119
|
oj (~> 3.10)
|
115
|
-
parallel (1.
|
116
|
-
parser (3.
|
120
|
+
parallel (1.23.0)
|
121
|
+
parser (3.2.2.3)
|
117
122
|
ast (~> 2.4.1)
|
123
|
+
racc
|
118
124
|
pry (0.14.2)
|
119
125
|
coderay (~> 1.1)
|
120
126
|
method_source (~> 1.0)
|
@@ -155,13 +161,13 @@ GEM
|
|
155
161
|
rake (13.0.6)
|
156
162
|
redis-client (0.14.1)
|
157
163
|
connection_pool
|
158
|
-
regexp_parser (2.
|
164
|
+
regexp_parser (2.8.1)
|
159
165
|
relaxed-rubocop (2.5)
|
160
166
|
request_store (1.5.1)
|
161
167
|
rack (>= 1.4)
|
162
168
|
request_store_rails (2.0.0)
|
163
169
|
concurrent-ruby (~> 1.0)
|
164
|
-
rexml (3.2.
|
170
|
+
rexml (3.2.6)
|
165
171
|
rspec (3.12.0)
|
166
172
|
rspec-core (~> 3.12.0)
|
167
173
|
rspec-expectations (~> 3.12.0)
|
@@ -183,21 +189,35 @@ GEM
|
|
183
189
|
rspec-mocks (~> 3.12)
|
184
190
|
rspec-support (~> 3.12)
|
185
191
|
rspec-support (3.12.1)
|
186
|
-
rubocop (1.
|
192
|
+
rubocop (1.55.0)
|
193
|
+
json (~> 2.3)
|
194
|
+
language_server-protocol (>= 3.17.0)
|
187
195
|
parallel (~> 1.10)
|
188
|
-
parser (>= 3.
|
196
|
+
parser (>= 3.2.2.3)
|
189
197
|
rainbow (>= 2.2.2, < 4.0)
|
190
198
|
regexp_parser (>= 1.8, < 3.0)
|
191
|
-
rexml
|
192
|
-
rubocop-ast (>= 1.
|
199
|
+
rexml (>= 3.2.5, < 4.0)
|
200
|
+
rubocop-ast (>= 1.28.1, < 2.0)
|
193
201
|
ruby-progressbar (~> 1.7)
|
194
|
-
unicode-display_width (>=
|
195
|
-
rubocop-ast (1.
|
196
|
-
parser (>= 3.
|
197
|
-
rubocop-
|
198
|
-
rubocop (~> 1.
|
199
|
-
|
200
|
-
|
202
|
+
unicode-display_width (>= 2.4.0, < 3.0)
|
203
|
+
rubocop-ast (1.29.0)
|
204
|
+
parser (>= 3.2.1.0)
|
205
|
+
rubocop-capybara (2.18.0)
|
206
|
+
rubocop (~> 1.41)
|
207
|
+
rubocop-factory_bot (2.23.1)
|
208
|
+
rubocop (~> 1.33)
|
209
|
+
rubocop-performance (1.18.0)
|
210
|
+
rubocop (>= 1.7.0, < 2.0)
|
211
|
+
rubocop-ast (>= 0.4.0)
|
212
|
+
rubocop-rails (2.20.2)
|
213
|
+
activesupport (>= 4.2.0)
|
214
|
+
rack (>= 1.1)
|
215
|
+
rubocop (>= 1.33.0, < 2.0)
|
216
|
+
rubocop-rspec (2.23.0)
|
217
|
+
rubocop (~> 1.33)
|
218
|
+
rubocop-capybara (~> 2.17)
|
219
|
+
rubocop-factory_bot (~> 2.22)
|
220
|
+
ruby-progressbar (1.13.0)
|
201
221
|
sidekiq (7.0.9)
|
202
222
|
concurrent-ruby (< 2)
|
203
223
|
connection_pool (>= 2.3.0)
|
@@ -213,7 +233,7 @@ GEM
|
|
213
233
|
thor (1.2.2)
|
214
234
|
tzinfo (2.0.6)
|
215
235
|
concurrent-ruby (~> 1.0)
|
216
|
-
unicode-display_width (2.
|
236
|
+
unicode-display_width (2.4.2)
|
217
237
|
webmock (3.18.1)
|
218
238
|
addressable (>= 2.8.0)
|
219
239
|
crack (>= 0.3.2)
|
@@ -229,7 +249,7 @@ PLATFORMS
|
|
229
249
|
DEPENDENCIES
|
230
250
|
bundler (~> 2.0)
|
231
251
|
dotenv-rails (~> 2.8.1)
|
232
|
-
getaround-rubocop (= 0.2.
|
252
|
+
getaround-rubocop (= 0.2.8)
|
233
253
|
getaround_utils!
|
234
254
|
lograge (~> 0.13.0)
|
235
255
|
ougai (~> 2.0)
|
@@ -239,9 +259,9 @@ DEPENDENCIES
|
|
239
259
|
request_store_rails (~> 2.0)
|
240
260
|
rspec (~> 3.9, >= 3.9.0)
|
241
261
|
rspec-rails (~> 6.0)
|
242
|
-
rubocop (= 1.
|
262
|
+
rubocop (= 1.55.0)
|
243
263
|
sidekiq (> 6.0, < 8.0)
|
244
264
|
webmock (~> 3.7)
|
245
265
|
|
246
266
|
BUNDLED WITH
|
247
|
-
2.3.
|
267
|
+
2.3.16
|
data/getaround_utils.gemspec
CHANGED
@@ -17,14 +17,17 @@ Gem::Specification.new do |gem|
|
|
17
17
|
`git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(spec)/}) }
|
18
18
|
end
|
19
19
|
|
20
|
+
# Common dependencies
|
21
|
+
gem.add_dependency 'rack', '~> 2.0'
|
22
|
+
|
20
23
|
# Development dependencies
|
21
24
|
gem.add_development_dependency 'bundler', '~> 2.0'
|
22
|
-
gem.add_development_dependency 'getaround-rubocop', '= 0.2.
|
25
|
+
gem.add_development_dependency 'getaround-rubocop', '= 0.2.8'
|
23
26
|
gem.add_development_dependency 'pry', '~> 0.14.0'
|
24
27
|
gem.add_development_dependency 'rake', '~> 13.0'
|
25
28
|
gem.add_development_dependency 'rspec', '~> 3.9', '>= 3.9.0'
|
26
29
|
gem.add_development_dependency 'rspec-rails', '~> 6.0'
|
27
|
-
gem.add_development_dependency 'rubocop', '= 1.
|
30
|
+
gem.add_development_dependency 'rubocop', '= 1.55.0'
|
28
31
|
gem.add_development_dependency 'webmock', '~> 3.7'
|
29
32
|
|
30
33
|
# Functional (optional) dependencies
|
@@ -0,0 +1,69 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'json'
|
4
|
+
require 'rack'
|
5
|
+
|
6
|
+
module GetaroundUtils; end
|
7
|
+
|
8
|
+
module GetaroundUtils::Engines; end
|
9
|
+
|
10
|
+
module GetaroundUtils::Engines::Health
|
11
|
+
RELEASE_VERSION_PATH = '/health/release_version'
|
12
|
+
COMMIT_SHA1_PATH = '/health/commit_sha1'
|
13
|
+
MIGRATION_STATUS_PATH = '/health/migration_status'
|
14
|
+
UNDEFINED = 'N/A'
|
15
|
+
|
16
|
+
def self.release_version
|
17
|
+
ENV['HEROKU_RELEASE_VERSION'] || ENV['PORTER_STACK_REVISION'] || ENV['PORTER_POD_REVISION']
|
18
|
+
end
|
19
|
+
|
20
|
+
def self.commit_sha1
|
21
|
+
ENV['HEROKU_SLUG_COMMIT'] || ENV['COMMIT_SHA1']
|
22
|
+
end
|
23
|
+
|
24
|
+
def self.needs_migration?
|
25
|
+
return false unless defined?(ActiveRecord)
|
26
|
+
|
27
|
+
ActiveRecord::Base.connection.migration_context.needs_migration?
|
28
|
+
end
|
29
|
+
|
30
|
+
def self.engine
|
31
|
+
Rack::Builder.new do
|
32
|
+
map RELEASE_VERSION_PATH do
|
33
|
+
use Rack::Head
|
34
|
+
|
35
|
+
run(lambda do |env|
|
36
|
+
req = Rack::Request.new(env)
|
37
|
+
return [405, { 'Content-Type' => 'text/plain' }, []] unless req.get?
|
38
|
+
|
39
|
+
content = GetaroundUtils::Engines::Health.release_version || UNDEFINED
|
40
|
+
[200, { 'Content-Type' => 'text/plain' }, [content]]
|
41
|
+
end)
|
42
|
+
end
|
43
|
+
|
44
|
+
map COMMIT_SHA1_PATH do
|
45
|
+
use Rack::Head
|
46
|
+
|
47
|
+
run(lambda do |env|
|
48
|
+
req = Rack::Request.new(env)
|
49
|
+
return [405, { 'Content-Type' => 'text/plain' }, []] unless req.get?
|
50
|
+
|
51
|
+
content = GetaroundUtils::Engines::Health.commit_sha1 || UNDEFINED
|
52
|
+
[200, { 'Content-Type' => 'text/plain' }, [content]]
|
53
|
+
end)
|
54
|
+
end
|
55
|
+
|
56
|
+
map MIGRATION_STATUS_PATH do
|
57
|
+
use Rack::Head
|
58
|
+
|
59
|
+
run(lambda do |env|
|
60
|
+
req = Rack::Request.new(env)
|
61
|
+
return [405, { 'Content-Type' => 'application/json' }, []] unless req.get?
|
62
|
+
|
63
|
+
content = { needs_migration: GetaroundUtils::Engines::Health.needs_migration? }
|
64
|
+
[200, { 'Content-Type' => 'application/json' }, [JSON.generate(content)]]
|
65
|
+
end)
|
66
|
+
end
|
67
|
+
end
|
68
|
+
end
|
69
|
+
end
|
@@ -43,6 +43,7 @@ class GetaroundUtils::Railties::Lograge < Rails::Railtie
|
|
43
43
|
|
44
44
|
initializer 'getaround_utils.action_controller' do
|
45
45
|
ActionController::Base.prepend LogrageActionController
|
46
|
+
ActionController::API.prepend LogrageActionController
|
46
47
|
end
|
47
48
|
|
48
49
|
HTTP_PARAMS = [:method, :path, :host, :remote_ip,
|
data/lib/getaround_utils.rb
CHANGED
metadata
CHANGED
@@ -1,16 +1,30 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: getaround_utils
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.28
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Drivy
|
8
8
|
- Laurent Humez
|
9
|
-
autorequire:
|
9
|
+
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2023-
|
12
|
+
date: 2023-11-24 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
|
+
- !ruby/object:Gem::Dependency
|
15
|
+
name: rack
|
16
|
+
requirement: !ruby/object:Gem::Requirement
|
17
|
+
requirements:
|
18
|
+
- - "~>"
|
19
|
+
- !ruby/object:Gem::Version
|
20
|
+
version: '2.0'
|
21
|
+
type: :runtime
|
22
|
+
prerelease: false
|
23
|
+
version_requirements: !ruby/object:Gem::Requirement
|
24
|
+
requirements:
|
25
|
+
- - "~>"
|
26
|
+
- !ruby/object:Gem::Version
|
27
|
+
version: '2.0'
|
14
28
|
- !ruby/object:Gem::Dependency
|
15
29
|
name: bundler
|
16
30
|
requirement: !ruby/object:Gem::Requirement
|
@@ -31,14 +45,14 @@ dependencies:
|
|
31
45
|
requirements:
|
32
46
|
- - '='
|
33
47
|
- !ruby/object:Gem::Version
|
34
|
-
version: 0.2.
|
48
|
+
version: 0.2.8
|
35
49
|
type: :development
|
36
50
|
prerelease: false
|
37
51
|
version_requirements: !ruby/object:Gem::Requirement
|
38
52
|
requirements:
|
39
53
|
- - '='
|
40
54
|
- !ruby/object:Gem::Version
|
41
|
-
version: 0.2.
|
55
|
+
version: 0.2.8
|
42
56
|
- !ruby/object:Gem::Dependency
|
43
57
|
name: pry
|
44
58
|
requirement: !ruby/object:Gem::Requirement
|
@@ -107,14 +121,14 @@ dependencies:
|
|
107
121
|
requirements:
|
108
122
|
- - '='
|
109
123
|
- !ruby/object:Gem::Version
|
110
|
-
version: 1.
|
124
|
+
version: 1.55.0
|
111
125
|
type: :development
|
112
126
|
prerelease: false
|
113
127
|
version_requirements: !ruby/object:Gem::Requirement
|
114
128
|
requirements:
|
115
129
|
- - '='
|
116
130
|
- !ruby/object:Gem::Version
|
117
|
-
version: 1.
|
131
|
+
version: 1.55.0
|
118
132
|
- !ruby/object:Gem::Dependency
|
119
133
|
name: webmock
|
120
134
|
requirement: !ruby/object:Gem::Requirement
|
@@ -233,6 +247,8 @@ files:
|
|
233
247
|
- README.md
|
234
248
|
- getaround_utils.gemspec
|
235
249
|
- lib/getaround_utils.rb
|
250
|
+
- lib/getaround_utils/engines.rb
|
251
|
+
- lib/getaround_utils/engines/health.rb
|
236
252
|
- lib/getaround_utils/mixins.rb
|
237
253
|
- lib/getaround_utils/mixins/loggable.rb
|
238
254
|
- lib/getaround_utils/ougai.rb
|
@@ -248,7 +264,7 @@ homepage: https://github.com/drivy
|
|
248
264
|
licenses:
|
249
265
|
- MIT
|
250
266
|
metadata: {}
|
251
|
-
post_install_message:
|
267
|
+
post_install_message:
|
252
268
|
rdoc_options: []
|
253
269
|
require_paths:
|
254
270
|
- lib
|
@@ -264,7 +280,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
264
280
|
version: '0'
|
265
281
|
requirements: []
|
266
282
|
rubygems_version: 3.1.6
|
267
|
-
signing_key:
|
283
|
+
signing_key:
|
268
284
|
specification_version: 4
|
269
285
|
summary: Backend shared utility classes
|
270
286
|
test_files: []
|