esirb 0.2.2 → 0.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: afe670cedb5360c4072bf70a919f2d4516b771e7732fb6d8394314733beb7fe9
4
- data.tar.gz: 9e8db2a4567390ec3d908c17994daf8977c91adf6ab8395ec8623ed36b1d1297
3
+ metadata.gz: cd136bcdbc33d25122ff858ed5716db09e0ff34b3e262b09fda35f78df150b62
4
+ data.tar.gz: 86cdf99e1f56c391805baabebd655f3a098e3a86b751ef2b21dc44807d2abd22
5
5
  SHA512:
6
- metadata.gz: 6dc74299c42271adb27cdfdb23353fe287c4007e4f3bff5a66f044dce2202521c2c0d7a462bd168b509281dda9a47aaaf6fa90066f5bcc73b4eab3dea70650a7
7
- data.tar.gz: e2003cbba24237686df1f6d0d52ac923536af5c7995e8be9cfc5faca88df07a5244fa21920389696ce3e17daad0a854f925fb3c915fcbc6aa5f5355977971b49
6
+ metadata.gz: 0724b07f4fbaf5091e5b7ac7102e56ce714e51052a339a727bf65679ead59702d93c91392d60baddc9dfd2190d2afefecccd20320f1f89df076a52a506f0f2d4
7
+ data.tar.gz: 49d3ea1c34e4124cdd46efb0b174ef954375d0386c1ee8779932cc3b604a08f8f99bd275599ec594fd52306c679ce862345e157947236e26bab21a4a6b9fb1f6
data/lib/esirb/client.rb CHANGED
@@ -13,7 +13,7 @@ module Esirb
13
13
  "If-None-Match" => "",
14
14
  "X-Tenant" => "tranquility",
15
15
  "X-Compatibility-Date" => "2026-06-09"
16
- }
16
+ }.freeze
17
17
 
18
18
  attr_reader :token, :path, :tenant, :language, :cache, :cache_store, :raise_errors
19
19
 
@@ -28,17 +28,17 @@ module Esirb
28
28
 
29
29
  def connection
30
30
  @connection ||= Faraday.new(BASE_URL) do |c|
31
- c.request :authorization, "Bearer", token if token
32
-
33
31
  if cache
34
- c.use :http_cache,
35
- store: cache_store,
36
- strategy: Faraday::HttpCache::Strategies::ByUrl,
37
- serializer: Marshal
32
+ c.use :http_cache, store: cache_store, strategy: Faraday::HttpCache::Strategies::ByUrl, serializer: Marshal
38
33
  end
39
34
 
40
- c.request :json
41
35
  c.headers = DEFAULT_HEADERS
36
+ c.headers["X-Tenant"] = tenant if tenant
37
+ c.headers["Accept-Language"] = language if language
38
+
39
+ c.request :authorization, "Bearer", token if token
40
+ c.request :json
41
+
42
42
  c.response :raise_error if raise_errors
43
43
  c.response :json, content_type: "application/json"
44
44
  end
data/lib/esirb/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Esirb
4
- VERSION = "0.2.2"
4
+ VERSION = "0.3.0"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: esirb
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.2
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - sicks