antbird 0.5.1 → 0.5.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/antbird/client.rb +7 -3
- data/lib/antbird/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c8c2ff0b9a3dd9122be37ee481a7ddb606466b9d39eafd293a52d6586cde63af
|
4
|
+
data.tar.gz: dbb2577b6a4a89735da0e5612d222ab579b98542472459ded0ee01a5e5270732
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 55b3cff8582335c0cb6dd6b1fb60004398858c805845ad88ee9fe64280a5fa26c7dc31ee7b6fdcc798c016b9365a096071c76a2e141ea911f6cae7eff5b86a0b
|
7
|
+
data.tar.gz: 1a2ab8f3115fd612c727466eb5438b6897a323b77f5dcdad70647a31758ac9f959f05446e8312fd3f8a9b7a46f00001656d265c74f82aa77eb02dc1becd5a845
|
data/lib/antbird/client.rb
CHANGED
@@ -25,8 +25,6 @@ module Antbird
|
|
25
25
|
if version
|
26
26
|
@version = version
|
27
27
|
@distribution = distribution
|
28
|
-
else
|
29
|
-
fetch_version_and_distribution
|
30
28
|
end
|
31
29
|
|
32
30
|
@api_specs = {}
|
@@ -203,6 +201,8 @@ module Antbird
|
|
203
201
|
end
|
204
202
|
|
205
203
|
def opensearch?
|
204
|
+
ensure_version_and_distribution
|
205
|
+
|
206
206
|
distribution == 'opensearch'
|
207
207
|
end
|
208
208
|
|
@@ -249,7 +249,9 @@ module Antbird
|
|
249
249
|
end
|
250
250
|
end
|
251
251
|
|
252
|
-
def
|
252
|
+
def ensure_version_and_distribution
|
253
|
+
return if version
|
254
|
+
|
253
255
|
version_hash = connection.get('/').body.dig('version')
|
254
256
|
@version = version_hash['number']
|
255
257
|
@distribution = version_hash['distribution']
|
@@ -262,6 +264,8 @@ module Antbird
|
|
262
264
|
def ensure_api_spec_loaded
|
263
265
|
return if api_specs_loaded?
|
264
266
|
|
267
|
+
ensure_version_and_distribution
|
268
|
+
|
265
269
|
if opensearch?
|
266
270
|
require "antbird/rest_api/rest_api_opensearch_v#{class_version}"
|
267
271
|
extend Antbird::RestApi.const_get "RestApiOpensearchV#{class_version}"
|
data/lib/antbird/version.rb
CHANGED