barkibu-kb 0.17.0 → 0.19.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: a893e849049eb479e171c341b8cf56d22a2ade1c248083ee5a9cd66f251c7cc4
4
- data.tar.gz: 2008d1d02b6ecc392c5db59d579a07659de53ad4302c97b55d08cd24b0030f0c
3
+ metadata.gz: da71c1eb9a90a1dd14cb7d58a976dfcf72d3ba5dbd961e068636469a799c5b5b
4
+ data.tar.gz: 3d4af2651a9c4231426da4acd0fe90c154f2e7da53e9a2df02367c96fe4dc46b
5
5
  SHA512:
6
- metadata.gz: 904e31438bad89e6762e43031a6ae3914dd8d7d5095faed0787ee44a4cc2d945cfbbf6ebae92680db63ab3fce64553715cd496963fd365f33e87fa80dfcaacce
7
- data.tar.gz: 6f84cc1cef486ecc571c22ad4e0a08db129b6d456f5b722a389679af84a34e291e4ae7ee0f63b5f3db4b68bdb93802a146dd68a5c8ac74870f41c01a41fb312f
6
+ metadata.gz: ec8ca5cab62f6b81b695d3942660bae608042ac0355377b65a9a45ab3fcfb7eb680fb0213d0d9d0e4f5fc86f162d177593fcf0988b9e43530c2c919dde658237
7
+ data.tar.gz: 469c0277b211553d77cfa476c6bb294bec3ff0fb728fd1d3ada5c867a35eb884240b15d44d1728d1115d79c1cbe65099e4754dc0a90a110adbec9444d675f2fc
data/CHANGELOG.md CHANGED
@@ -5,6 +5,14 @@ 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.19.0]
9
+ - Remove useless double splat argument usage on concern causing problem for ruby version >= 3
10
+
11
+ ## [0.18.0]
12
+
13
+ - add support for `payment_interval_months` attribute on `PetContract`
14
+ - add active-record like comparison for models
15
+
8
16
  ## [0.17.0]
9
17
 
10
18
  - add `KB::Referral` model to create a referral on a PetParent
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- barkibu-kb (0.17.0)
4
+ barkibu-kb (0.19.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.17.0)
14
- barkibu-kb (= 0.17.0)
13
+ barkibu-kb-fake (0.19.0)
14
+ barkibu-kb (= 0.19.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)
23
- activesupport (= 7.0.3)
24
- activerecord (7.0.3)
25
- activemodel (= 7.0.3)
26
- activesupport (= 7.0.3)
27
- activesupport (7.0.3)
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,22 +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.0.2)
38
- i18n_data (~> 0.16.0)
39
- sixarm_ruby_unaccent (~> 1.1)
36
+ concurrent-ruby (1.2.2)
37
+ countries (5.3.1)
38
+ unaccent (~> 0.3)
40
39
  crack (0.4.5)
41
40
  rexml
42
41
  diff-lcs (1.4.4)
43
42
  docile (1.4.0)
44
43
  domain_name (0.5.20190701)
45
44
  unf (>= 0.0.5, < 1.0.0)
46
- dry-configurable (0.15.0)
47
- concurrent-ruby (~> 1.0)
45
+ dry-configurable (0.16.1)
48
46
  dry-core (~> 0.6)
49
- dry-core (0.7.1)
47
+ zeitwerk (~> 2.6)
48
+ dry-core (0.9.1)
50
49
  concurrent-ruby (~> 1.0)
51
- faraday (1.10.0)
50
+ zeitwerk (~> 2.6)
51
+ faraday (1.10.3)
52
52
  faraday-em_http (~> 1.0)
53
53
  faraday-em_synchrony (~> 1.0)
54
54
  faraday-excon (~> 1.1)
@@ -81,7 +81,7 @@ GEM
81
81
  ffi (>= 1.0.0)
82
82
  rake
83
83
  hashdiff (1.0.1)
84
- http (5.1.0)
84
+ http (5.1.1)
85
85
  addressable (~> 2.8)
86
86
  http-cookie (~> 1.0)
87
87
  http-form_data (~> 2.2)
@@ -89,23 +89,21 @@ GEM
89
89
  http-cookie (1.0.5)
90
90
  domain_name (~> 0.5)
91
91
  http-form_data (2.3.0)
92
- i18n (1.10.0)
92
+ i18n (1.12.0)
93
93
  concurrent-ruby (~> 1.0)
94
- i18n_data (0.16.0)
95
- simple_po_parser (~> 1.1)
96
94
  llhttp-ffi (0.4.0)
97
95
  ffi-compiler (~> 1.0)
98
96
  rake (~> 13.0)
99
- minitest (5.16.1)
100
- multipart-post (2.2.3)
101
- mustermann (1.1.1)
97
+ minitest (5.18.0)
98
+ multipart-post (2.3.0)
99
+ mustermann (3.0.0)
102
100
  ruby2_keywords (~> 0.0.1)
103
101
  parallel (1.21.0)
104
102
  parser (3.0.2.0)
105
103
  ast (~> 2.4.1)
106
104
  public_suffix (4.0.7)
107
- rack (2.2.3.1)
108
- rack-protection (2.2.0)
105
+ rack (2.2.6.3)
106
+ rack-protection (3.0.5)
109
107
  rack
110
108
  rainbow (3.0.0)
111
109
  rake (13.0.6)
@@ -139,22 +137,21 @@ GEM
139
137
  rubocop (~> 1.19)
140
138
  ruby-progressbar (1.11.0)
141
139
  ruby2_keywords (0.0.5)
142
- simple_po_parser (1.1.6)
143
140
  simplecov (0.21.2)
144
141
  docile (~> 1.1)
145
142
  simplecov-html (~> 0.11)
146
143
  simplecov_json_formatter (~> 0.1)
147
144
  simplecov-html (0.12.3)
148
145
  simplecov_json_formatter (0.1.3)
149
- sinatra (2.2.0)
150
- mustermann (~> 1.0)
151
- rack (~> 2.2)
152
- rack-protection (= 2.2.0)
146
+ sinatra (3.0.5)
147
+ mustermann (~> 3.0)
148
+ rack (~> 2.2, >= 2.2.4)
149
+ rack-protection (= 3.0.5)
153
150
  tilt (~> 2.0)
154
- sixarm_ruby_unaccent (1.2.0)
155
- tilt (2.0.10)
156
- tzinfo (2.0.4)
151
+ tilt (2.1.0)
152
+ tzinfo (2.0.6)
157
153
  concurrent-ruby (~> 1.0)
154
+ unaccent (0.4.0)
158
155
  unf (0.1.4)
159
156
  unf_ext
160
157
  unf_ext (0.0.8.2)
@@ -163,6 +160,7 @@ GEM
163
160
  addressable (>= 2.8.0)
164
161
  crack (>= 0.3.2)
165
162
  hashdiff (>= 0.4.0, < 2.0.0)
163
+ zeitwerk (2.6.7)
166
164
 
167
165
  PLATFORMS
168
166
  ruby
@@ -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
@@ -26,6 +26,16 @@ module KB
26
26
  @persisted = true
27
27
  end
28
28
 
29
+ # Copy-paste of ActiveRecord equality logic
30
+ # https://github.com/rails/rails/blob/main/activerecord/lib/active_record/core.rb
31
+ def ==(other)
32
+ super ||
33
+ (other.instance_of?(self.class) &&
34
+ !key.nil? &&
35
+ other.key == key)
36
+ end
37
+ alias eql? ==
38
+
29
39
  def self.define_attribute_methods(*fields)
30
40
  super
31
41
  fields.each do |field|
@@ -23,11 +23,11 @@ module KB
23
23
  conversion_utm_source conversion_utm_term
24
24
  conversion_utm_adgroup_id conversion_utm_campaign_id].freeze
25
25
  DATE_FIELDS = %i[policy_start_date policy_expiration_date].freeze
26
- INTEGER_FIELDS = %i[price_yearly price_monthly price_discount_yearly].freeze
26
+ INTEGER_FIELDS = %i[
27
+ price_yearly price_monthly price_discount_yearly payment_interval_months
28
+ ].freeze
27
29
  FIELDS = [*STRING_FIELDS, *DATE_FIELDS, *INTEGER_FIELDS].freeze
28
30
 
29
- IMMUTABLE_FIELDS = (FIELDS - %i[status contract_document policy_expiration_date]).freeze
30
-
31
31
  define_attribute_methods(*FIELDS)
32
32
 
33
33
  STRING_FIELDS.each do |field|
data/lib/kb/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module KB
2
- VERSION = '0.17.0'.freeze
2
+ VERSION = '0.19.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.17.0
4
+ version: 0.19.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-06-30 00:00:00.000000000 Z
11
+ date: 2023-03-06 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: []