antbird 0.5.0 → 0.5.1
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 +14 -10
- data/lib/antbird/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7f6be201e13340d8e4f7cf122049f745af8c9af0d4d6390601a3264bef077992
|
4
|
+
data.tar.gz: 7f1540e56bdc23db02b1300971550bdce93bb0ac426a0010d2fa4a9fc245e8f4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9d135caf322ed4ad9056883283062ffbf5f43073087b29befa60033273f95ac87dae3b0f2b21fac79eb15d1bf21fe23d3cf136acd89e5ac46c4f2add0bee7678
|
7
|
+
data.tar.gz: c8df3422cf55ffad4f18e4016e0ec972570c525f53250a48962d482d9ac7d45585cf0f2ad8357eb74e1b73dbf2309f2949bcc4ec8e3b016e7f71f07588295848
|
data/lib/antbird/client.rb
CHANGED
@@ -21,8 +21,13 @@ module Antbird
|
|
21
21
|
@url = url
|
22
22
|
|
23
23
|
@scope = scope.transform_keys(&:to_sym)
|
24
|
-
|
25
|
-
|
24
|
+
|
25
|
+
if version
|
26
|
+
@version = version
|
27
|
+
@distribution = distribution
|
28
|
+
else
|
29
|
+
fetch_version_and_distribution
|
30
|
+
end
|
26
31
|
|
27
32
|
@api_specs = {}
|
28
33
|
end
|
@@ -198,7 +203,6 @@ module Antbird
|
|
198
203
|
end
|
199
204
|
|
200
205
|
def opensearch?
|
201
|
-
fetch_version
|
202
206
|
distribution == 'opensearch'
|
203
207
|
end
|
204
208
|
|
@@ -245,19 +249,19 @@ module Antbird
|
|
245
249
|
end
|
246
250
|
end
|
247
251
|
|
248
|
-
def
|
249
|
-
return if @version
|
250
|
-
|
252
|
+
def fetch_version_and_distribution
|
251
253
|
version_hash = connection.get('/').body.dig('version')
|
252
|
-
@version
|
253
|
-
@distribution
|
254
|
+
@version = version_hash['number']
|
255
|
+
@distribution = version_hash['distribution']
|
256
|
+
end
|
257
|
+
|
258
|
+
def class_version
|
259
|
+
version.split('.')[0, 2].join('_')
|
254
260
|
end
|
255
261
|
|
256
262
|
def ensure_api_spec_loaded
|
257
263
|
return if api_specs_loaded?
|
258
264
|
|
259
|
-
fetch_version
|
260
|
-
class_version = @version.split('.')[0, 2].join('_')
|
261
265
|
if opensearch?
|
262
266
|
require "antbird/rest_api/rest_api_opensearch_v#{class_version}"
|
263
267
|
extend Antbird::RestApi.const_get "RestApiOpensearchV#{class_version}"
|
data/lib/antbird/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: antbird
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.5.
|
4
|
+
version: 0.5.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- fukayatsu
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-12-
|
11
|
+
date: 2021-12-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: faraday
|