barkibu-kb 0.26.0 → 0.27.0

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: 764bc253dcc5b70bd9e72c7daf6f740813b82e4ab1c479e189c179ca247cb860
4
- data.tar.gz: addb4558e1b7e624f1c82c79818b26978814e4df605eeef54fa81f486b69df11
3
+ metadata.gz: be4768b7d24f774209a31733ac0e00209831fca472439774979b825a7cd10de3
4
+ data.tar.gz: be8447d966156578a51670ca233894505a1c416be5e5a18d831910e565d10367
5
5
  SHA512:
6
- metadata.gz: db382311f048cfedc62265241b487c05c40a977b0e906248426383d471db931f5b5fd169b6d69b51dcbef219d8d429e652d971a013ce1e101d22021161abf531
7
- data.tar.gz: 5d0e713464fc4eee1f8c1a6c4ca537caee773085a2a1f3178eba80f65abf16dafab7df10185483bfeab538656a207ec9bd8c4b7720336ccc80e1119e0c194ae4
6
+ metadata.gz: f16f6ffef3e44bc152ded87d4d5a091029b46823369a6c71adbbf2bc5919fe4c001415061fe43758a2a679d23375b3936dcecf80479f8425ec23cbabe6cd4686
7
+ data.tar.gz: 53e00f26cd104a280881721cd53cc628beb668859c631cad50bd47462b3f17d49ced01e923392bbddb3e933c16e07d138f908c41a7d39d06755942546edb922a
data/CHANGELOG.md CHANGED
@@ -8,6 +8,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
8
8
  ## [unreleased]
9
9
  - See diff: https://github.com/barkibu/kb-ruby/compare/v0.26...HEAD
10
10
 
11
+ # [0.27.0]
12
+ - Add configuration option for request timeout
13
+
11
14
  # [0.26.0]
12
15
  - Add `#iban` and `#update_iban` to `PetParent`
13
16
  - Add /iban endpoints in fake API
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- barkibu-kb (0.26.0)
4
+ barkibu-kb (0.27.0)
5
5
  activemodel (>= 4.0.2)
6
6
  activerecord
7
7
  activesupport (>= 3.0.0)
@@ -10,8 +10,8 @@ PATH
10
10
  faraday-http
11
11
  faraday_middleware
12
12
  i18n
13
- barkibu-kb-fake (0.26.0)
14
- barkibu-kb (= 0.26.0)
13
+ barkibu-kb-fake (0.27.0)
14
+ barkibu-kb (= 0.27.0)
15
15
  countries
16
16
  sinatra
17
17
  webmock
data/README.md CHANGED
@@ -42,6 +42,12 @@ KB.config.cache.expires_in = 1.second # 0 by default
42
42
  KB.config.log_level = :debugger # :info by default
43
43
  ```
44
44
 
45
+ #### Request timeout configuration
46
+ ```ruby
47
+ # config/initializers/kb_ruby.rb
48
+ KB.config.request.timeout = 10 # 5 by default
49
+ ```
50
+
45
51
  ### Exposed Entities
46
52
 
47
53
  #### Pet Parent 🧍🏾
data/lib/barkibu-kb.rb CHANGED
@@ -17,6 +17,10 @@ module KB
17
17
  end
18
18
 
19
19
  setting :log_level, default: :info
20
+
21
+ setting :request do
22
+ setting :timeout, default: 5
23
+ end
20
24
  end
21
25
 
22
26
  require 'kb/inflections'
data/lib/kb/client.rb CHANGED
@@ -74,7 +74,9 @@ module KB
74
74
  end
75
75
 
76
76
  def connection
77
- @connection ||= Faraday.new(url: base_url, headers: headers) do |conn|
77
+ @connection ||= Faraday.new(url: base_url,
78
+ headers: headers,
79
+ request: { timeout: KB.config.request.timeout }) do |conn|
78
80
  conn.response :json
79
81
  conn.response :raise_error
80
82
  if KB.config.log_level == :debugger
data/lib/kb/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module KB
2
- VERSION = '0.26.0'.freeze
2
+ VERSION = '0.27.0'.freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: barkibu-kb
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.26.0
4
+ version: 0.27.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Léo Figea
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2024-06-14 00:00:00.000000000 Z
11
+ date: 2024-07-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: dry-configurable