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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: c8c2ff0b9a3dd9122be37ee481a7ddb606466b9d39eafd293a52d6586cde63af
4
- data.tar.gz: dbb2577b6a4a89735da0e5612d222ab579b98542472459ded0ee01a5e5270732
3
+ metadata.gz: b0f0ed1c7dabf81835ef85e0a5a105b19c233ade75532df0462228277f447e11
4
+ data.tar.gz: c56cf7841b8309571e54e03cb13ce006d9a17e04222ed5afda7921aa89c468a1
5
5
  SHA512:
6
- metadata.gz: 55b3cff8582335c0cb6dd6b1fb60004398858c805845ad88ee9fe64280a5fa26c7dc31ee7b6fdcc798c016b9365a096071c76a2e141ea911f6cae7eff5b86a0b
7
- data.tar.gz: 1a2ab8f3115fd612c727466eb5438b6897a323b77f5dcdad70647a31758ac9f959f05446e8312fd3f8a9b7a46f00001656d265c74f82aa77eb02dc1becd5a845
6
+ metadata.gz: fee97bce77ff300cd14b51fd4de70214a7521bd5f58e19b1473a97612951a25ba7632287c8889263708b1566b8a963b172f060a9782379445458f83a46072dc6
7
+ data.tar.gz: 57fb63974675572ff7222a0a9af53f4c2b00258a7f0c6ec69647a09f1a68aba8120f05448bc4caa35ddb5232b9a389e21ecc4e0298aeab787ca4b11c284ac51b
@@ -29,7 +29,7 @@ module Antbird
29
29
 
30
30
  @api_specs = {}
31
31
  end
32
- attr_reader :scope, :url, :version, :distribution
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 = connection.get('/').body.dig('version')
267
+ version_hash = response.body.dig('version')
256
268
  @version = version_hash['number']
257
269
  @distribution = version_hash['distribution']
258
270
  end
@@ -1,3 +1,3 @@
1
1
  module Antbird
2
- VERSION = "0.5.2"
2
+ VERSION = "0.5.3"
3
3
  end
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.2
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: 2021-12-09 00:00:00.000000000 Z
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.1.6
211
+ rubygems_version: 3.3.3
212
212
  signing_key:
213
213
  specification_version: 4
214
214
  summary: Nearly auto-generated Elasticsearch client