antbird 0.5.2 → 0.5.3
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 +15 -3
- data/lib/antbird/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b0f0ed1c7dabf81835ef85e0a5a105b19c233ade75532df0462228277f447e11
|
4
|
+
data.tar.gz: c56cf7841b8309571e54e03cb13ce006d9a17e04222ed5afda7921aa89c468a1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fee97bce77ff300cd14b51fd4de70214a7521bd5f58e19b1473a97612951a25ba7632287c8889263708b1566b8a963b172f060a9782379445458f83a46072dc6
|
7
|
+
data.tar.gz: 57fb63974675572ff7222a0a9af53f4c2b00258a7f0c6ec69647a09f1a68aba8120f05448bc4caa35ddb5232b9a389e21ecc4e0298aeab787ca4b11c284ac51b
|
data/lib/antbird/client.rb
CHANGED
@@ -29,7 +29,7 @@ module Antbird
|
|
29
29
|
|
30
30
|
@api_specs = {}
|
31
31
|
end
|
32
|
-
attr_reader :scope, :url, :
|
32
|
+
attr_reader :scope, :url, :distribution
|
33
33
|
attr_reader :read_timeout, :open_timeout, :adapter
|
34
34
|
attr_reader :api_specs, :last_request
|
35
35
|
|
@@ -218,6 +218,13 @@ module Antbird
|
|
218
218
|
elasticsearch? && Gem::Version.new(version) >= Gem::Version.new('7.6.0')
|
219
219
|
end
|
220
220
|
|
221
|
+
def version
|
222
|
+
return @version if @version
|
223
|
+
|
224
|
+
ensure_version_and_distribution
|
225
|
+
@version
|
226
|
+
end
|
227
|
+
|
221
228
|
private
|
222
229
|
|
223
230
|
# NOTE: stable sort
|
@@ -250,9 +257,14 @@ module Antbird
|
|
250
257
|
end
|
251
258
|
|
252
259
|
def ensure_version_and_distribution
|
253
|
-
return if version
|
260
|
+
return if @version
|
261
|
+
|
262
|
+
response = connection.get('/')
|
263
|
+
if response.status == 401
|
264
|
+
raise Antbird::Client::RequestError.new(response)
|
265
|
+
end
|
254
266
|
|
255
|
-
version_hash =
|
267
|
+
version_hash = response.body.dig('version')
|
256
268
|
@version = version_hash['number']
|
257
269
|
@distribution = version_hash['distribution']
|
258
270
|
end
|
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.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- fukayatsu
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2022-01-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: faraday
|
@@ -208,7 +208,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
208
208
|
- !ruby/object:Gem::Version
|
209
209
|
version: '0'
|
210
210
|
requirements: []
|
211
|
-
rubygems_version: 3.
|
211
|
+
rubygems_version: 3.3.3
|
212
212
|
signing_key:
|
213
213
|
specification_version: 4
|
214
214
|
summary: Nearly auto-generated Elasticsearch client
|