barkibu-kb 0.19.0 → 0.20.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: da71c1eb9a90a1dd14cb7d58a976dfcf72d3ba5dbd961e068636469a799c5b5b
4
- data.tar.gz: 3d4af2651a9c4231426da4acd0fe90c154f2e7da53e9a2df02367c96fe4dc46b
3
+ metadata.gz: f8144ce65eda7fea83254b2aaa17d47bee03cb99c749832d2b7a54e9ab38bd60
4
+ data.tar.gz: aec47c647a9adb72e18031e3e33c82950bb00b249e0feaebe7c92a13c7da5171
5
5
  SHA512:
6
- metadata.gz: ec8ca5cab62f6b81b695d3942660bae608042ac0355377b65a9a45ab3fcfb7eb680fb0213d0d9d0e4f5fc86f162d177593fcf0988b9e43530c2c919dde658237
7
- data.tar.gz: 469c0277b211553d77cfa476c6bb294bec3ff0fb728fd1d3ada5c867a35eb884240b15d44d1728d1115d79c1cbe65099e4754dc0a90a110adbec9444d675f2fc
6
+ metadata.gz: 637282d65870088123575aff253b3b59b96f2a9723f7265794f2df46de7b7ccd25b91154098c6b89a3d667b96e3673b434e2ee2ac4cbbe23449d9f730b22c9fa
7
+ data.tar.gz: 220d29688b08f7db663b4dfcda3fb0ceb3794d8e2aa039c55836ddc52a7d2f31dd8537a688e8c251249391033707c4dd9f82bec85ea84cbc7407a11b017b0092
data/CHANGELOG.md CHANGED
@@ -5,6 +5,9 @@ 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
+
8
11
  ## [0.19.0]
9
12
  - Remove useless double splat argument usage on concern causing problem for ruby version >= 3
10
13
 
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- barkibu-kb (0.19.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.19.0)
14
- barkibu-kb (= 0.19.0)
13
+ barkibu-kb-fake (0.20.0)
14
+ barkibu-kb (= 0.20.0)
15
15
  countries
16
16
  sinatra
17
17
  webmock
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
@@ -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.19.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.19.0
4
+ version: 0.20.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: 2023-03-06 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