barkibu-kb 0.18.0 → 0.20.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: 6ee4b2ec349cc4d1291d0e8ec58b55040ef144eb3f4524bfe9b7c3fe118225d9
4
- data.tar.gz: 70983b7aaf88044333e7b42ab691519f97db4d42f8aa4feeb7bfd729a07e143f
3
+ metadata.gz: f8144ce65eda7fea83254b2aaa17d47bee03cb99c749832d2b7a54e9ab38bd60
4
+ data.tar.gz: aec47c647a9adb72e18031e3e33c82950bb00b249e0feaebe7c92a13c7da5171
5
5
  SHA512:
6
- metadata.gz: 8b02676cc615a82d5a24e7dd447613d046f6f68a24ba76885797685adb88f4e6e19b1731218a657255c6d1ec37e41a435bd2e753e4f9144b06872b0c6ccde21e
7
- data.tar.gz: 536d9e36b1ed11df391ea22c851d3effcd90fe5edc4950847ec524cda9f726d7777fa1a7de732f787620e4ba7f7f15fe7ee46657a444e8ae60283784f47df47b
6
+ metadata.gz: 637282d65870088123575aff253b3b59b96f2a9723f7265794f2df46de7b7ccd25b91154098c6b89a3d667b96e3673b434e2ee2ac4cbbe23449d9f730b22c9fa
7
+ data.tar.gz: 220d29688b08f7db663b4dfcda3fb0ceb3794d8e2aa039c55836ddc52a7d2f31dd8537a688e8c251249391033707c4dd9f82bec85ea84cbc7407a11b017b0092
data/CHANGELOG.md CHANGED
@@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file.
5
5
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6
6
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
7
 
8
+ ## [0.20.0]
9
+ - Expose cache clearing API on client/model
10
+
11
+ ## [0.19.0]
12
+ - Remove useless double splat argument usage on concern causing problem for ruby version >= 3
13
+
8
14
  ## [0.18.0]
9
15
 
10
16
  - add support for `payment_interval_months` attribute on `PetContract`
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- barkibu-kb (0.18.0)
4
+ barkibu-kb (0.20.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.18.0)
14
- barkibu-kb (= 0.18.0)
13
+ barkibu-kb-fake (0.20.0)
14
+ barkibu-kb (= 0.20.0)
15
15
  countries
16
16
  sinatra
17
17
  webmock
@@ -19,12 +19,12 @@ PATH
19
19
  GEM
20
20
  remote: https://rubygems.org/
21
21
  specs:
22
- activemodel (7.0.3.1)
23
- activesupport (= 7.0.3.1)
24
- activerecord (7.0.3.1)
25
- activemodel (= 7.0.3.1)
26
- activesupport (= 7.0.3.1)
27
- activesupport (7.0.3.1)
22
+ activemodel (7.0.4.2)
23
+ activesupport (= 7.0.4.2)
24
+ activerecord (7.0.4.2)
25
+ activemodel (= 7.0.4.2)
26
+ activesupport (= 7.0.4.2)
27
+ activesupport (7.0.4.2)
28
28
  concurrent-ruby (~> 1.0, >= 1.0.2)
29
29
  i18n (>= 1.6, < 2)
30
30
  minitest (>= 5.1)
@@ -33,21 +33,22 @@ GEM
33
33
  public_suffix (>= 2.0.2, < 5.0)
34
34
  ast (2.4.2)
35
35
  byebug (11.1.3)
36
- concurrent-ruby (1.1.10)
37
- countries (5.1.2)
38
- sixarm_ruby_unaccent (~> 1.1)
36
+ concurrent-ruby (1.2.2)
37
+ countries (5.3.1)
38
+ unaccent (~> 0.3)
39
39
  crack (0.4.5)
40
40
  rexml
41
41
  diff-lcs (1.4.4)
42
42
  docile (1.4.0)
43
43
  domain_name (0.5.20190701)
44
44
  unf (>= 0.0.5, < 1.0.0)
45
- dry-configurable (0.15.0)
46
- concurrent-ruby (~> 1.0)
45
+ dry-configurable (0.16.1)
47
46
  dry-core (~> 0.6)
48
- dry-core (0.8.1)
47
+ zeitwerk (~> 2.6)
48
+ dry-core (0.9.1)
49
49
  concurrent-ruby (~> 1.0)
50
- faraday (1.10.2)
50
+ zeitwerk (~> 2.6)
51
+ faraday (1.10.3)
51
52
  faraday-em_http (~> 1.0)
52
53
  faraday-em_synchrony (~> 1.0)
53
54
  faraday-excon (~> 1.1)
@@ -80,7 +81,7 @@ GEM
80
81
  ffi (>= 1.0.0)
81
82
  rake
82
83
  hashdiff (1.0.1)
83
- http (5.1.0)
84
+ http (5.1.1)
84
85
  addressable (~> 2.8)
85
86
  http-cookie (~> 1.0)
86
87
  http-form_data (~> 2.2)
@@ -93,16 +94,16 @@ GEM
93
94
  llhttp-ffi (0.4.0)
94
95
  ffi-compiler (~> 1.0)
95
96
  rake (~> 13.0)
96
- minitest (5.16.3)
97
- multipart-post (2.2.3)
98
- mustermann (2.0.2)
97
+ minitest (5.18.0)
98
+ multipart-post (2.3.0)
99
+ mustermann (3.0.0)
99
100
  ruby2_keywords (~> 0.0.1)
100
101
  parallel (1.21.0)
101
102
  parser (3.0.2.0)
102
103
  ast (~> 2.4.1)
103
104
  public_suffix (4.0.7)
104
- rack (2.2.4)
105
- rack-protection (2.2.2)
105
+ rack (2.2.6.3)
106
+ rack-protection (3.0.5)
106
107
  rack
107
108
  rainbow (3.0.0)
108
109
  rake (13.0.6)
@@ -142,15 +143,15 @@ GEM
142
143
  simplecov_json_formatter (~> 0.1)
143
144
  simplecov-html (0.12.3)
144
145
  simplecov_json_formatter (0.1.3)
145
- sinatra (2.2.2)
146
- mustermann (~> 2.0)
147
- rack (~> 2.2)
148
- rack-protection (= 2.2.2)
146
+ sinatra (3.0.5)
147
+ mustermann (~> 3.0)
148
+ rack (~> 2.2, >= 2.2.4)
149
+ rack-protection (= 3.0.5)
149
150
  tilt (~> 2.0)
150
- sixarm_ruby_unaccent (1.2.0)
151
- tilt (2.0.11)
152
- tzinfo (2.0.5)
151
+ tilt (2.1.0)
152
+ tzinfo (2.0.6)
153
153
  concurrent-ruby (~> 1.0)
154
+ unaccent (0.4.0)
154
155
  unf (0.1.4)
155
156
  unf_ext
156
157
  unf_ext (0.0.8.2)
@@ -159,6 +160,7 @@ GEM
159
160
  addressable (>= 2.8.0)
160
161
  crack (>= 0.3.2)
161
162
  hashdiff (>= 0.4.0, < 2.0.0)
163
+ zeitwerk (2.6.7)
162
164
 
163
165
  PLATFORMS
164
166
  ruby
data/lib/kb/client.rb CHANGED
@@ -37,12 +37,12 @@ module KB
37
37
  end
38
38
 
39
39
  def update(key, attributes)
40
- KB::Cache.delete("#{@base_url}/#{key}")
40
+ clear_cache_for(key)
41
41
  connection.patch(key.to_s, attributes_to_json(attributes)).body
42
42
  end
43
43
 
44
44
  def destroy(key)
45
- KB::Cache.delete("#{@base_url}/#{key}")
45
+ clear_cache_for(key)
46
46
  connection.delete(key.to_s).body
47
47
  end
48
48
 
@@ -50,6 +50,10 @@ module KB
50
50
  connection.put('', attributes_to_json(attributes)).body
51
51
  end
52
52
 
53
+ def clear_cache_for(key)
54
+ KB::Cache.delete("#{@base_url}/#{key}")
55
+ end
56
+
53
57
  private
54
58
 
55
59
  def headers
@@ -44,7 +44,7 @@ module KB
44
44
  end
45
45
 
46
46
  singleton_class.instance_eval do
47
- define_method(:kb_find_by) do |**attributes|
47
+ define_method(:kb_find_by) do |attributes|
48
48
  kb_model = model.all(attributes).first
49
49
  return nil if kb_model.nil?
50
50
 
@@ -57,7 +57,7 @@ module KB
57
57
  end
58
58
  end
59
59
 
60
- def kb_find_by!(**attributes)
60
+ def kb_find_by!(attributes)
61
61
  kb_find_by(attributes).presence || raise(ActiveRecord::RecordNotFound)
62
62
  end
63
63
  end
@@ -11,6 +11,10 @@ module KB
11
11
  define_model_callbacks :save
12
12
  after_save :persist!
13
13
 
14
+ class << self
15
+ delegate :clear_cache_for, to: :kb_client
16
+ end
17
+
14
18
  def initialize(attributes = {})
15
19
  super
16
20
  @persisted = false
data/lib/kb/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module KB
2
- VERSION = '0.18.0'.freeze
2
+ VERSION = '0.20.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.18.0
4
+ version: 0.20.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Léo Figea
8
- autorequire:
8
+ autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2022-09-08 00:00:00.000000000 Z
11
+ date: 2023-03-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: dry-configurable
@@ -319,7 +319,7 @@ licenses:
319
319
  - MIT
320
320
  metadata:
321
321
  homepage_uri: https://app.barkibu.com
322
- post_install_message:
322
+ post_install_message:
323
323
  rdoc_options: []
324
324
  require_paths:
325
325
  - lib
@@ -334,8 +334,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
334
334
  - !ruby/object:Gem::Version
335
335
  version: '0'
336
336
  requirements: []
337
- rubygems_version: 3.3.7
338
- signing_key:
337
+ rubygems_version: 3.1.4
338
+ signing_key:
339
339
  specification_version: 4
340
340
  summary: Barkibu's Knowledge Base API sdk
341
341
  test_files: []