From cb17d3d29a1b9a4ffee15db34d6301c775ac8ee6 Mon Sep 17 00:00:00 2001 From: Edu Saborit Date: Fri, 1 Mar 2024 20:29:01 +0100 Subject: [PATCH 1/5] Update Rubocop to the first minor version supporting TargetRubyVersion: 3.2.3 --- .rubocop.yml | 3 +++ Gemfile.lock | 26 ++++++++++++----------- lib/kb/validators/uniqueness_validator.rb | 4 ++-- 3 files changed, 19 insertions(+), 14 deletions(-) diff --git a/.rubocop.yml b/.rubocop.yml index fa68e533..ce9289c1 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -11,6 +11,9 @@ # require: rubocop-rspec +Gemspec/RequireMFA: + Enabled: false + AllCops: TargetRubyVersion: 2.6.5 NewCops: enable diff --git a/Gemfile.lock b/Gemfile.lock index cee140dc..b423797c 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -98,17 +98,19 @@ GEM multipart-post (2.3.0) mustermann (3.0.0) ruby2_keywords (~> 0.0.1) - parallel (1.21.0) - parser (3.0.2.0) + parallel (1.24.0) + parser (3.3.0.5) ast (~> 2.4.1) + racc public_suffix (4.0.7) + racc (1.7.3) rack (2.2.6.3) rack-protection (3.0.5) rack - rainbow (3.0.0) + rainbow (3.1.1) rake (13.0.6) - regexp_parser (2.1.1) - rexml (3.2.5) + regexp_parser (2.9.0) + rexml (3.2.6) rspec (3.10.0) rspec-core (~> 3.10.0) rspec-expectations (~> 3.10.0) @@ -122,20 +124,20 @@ GEM diff-lcs (>= 1.2.0, < 2.0) rspec-support (~> 3.10.0) rspec-support (3.10.2) - rubocop (1.21.0) + rubocop (1.26.0) parallel (~> 1.10) - parser (>= 3.0.0.0) + parser (>= 3.1.0.0) rainbow (>= 2.2.2, < 4.0) regexp_parser (>= 1.8, < 3.0) rexml - rubocop-ast (>= 1.9.1, < 2.0) + rubocop-ast (>= 1.16.0, < 2.0) ruby-progressbar (~> 1.7) unicode-display_width (>= 1.4.0, < 3.0) - rubocop-ast (1.11.0) - parser (>= 3.0.1.1) + rubocop-ast (1.31.1) + parser (>= 3.3.0.4) rubocop-rspec (2.5.0) rubocop (~> 1.19) - ruby-progressbar (1.11.0) + ruby-progressbar (1.13.0) ruby2_keywords (0.0.5) simplecov (0.21.2) docile (~> 1.1) @@ -155,7 +157,7 @@ GEM unf (0.1.4) unf_ext unf_ext (0.0.8.2) - unicode-display_width (2.1.0) + unicode-display_width (2.5.0) webmock (3.14.0) addressable (>= 2.8.0) crack (>= 0.3.2) diff --git a/lib/kb/validators/uniqueness_validator.rb b/lib/kb/validators/uniqueness_validator.rb index 63cf8089..a94ab3d5 100644 --- a/lib/kb/validators/uniqueness_validator.rb +++ b/lib/kb/validators/uniqueness_validator.rb @@ -18,9 +18,9 @@ def all_records(record, filters) end def scope_filters(record, _attribute, _value) - Array.wrap(options[:scope]).map do |scope_attribute| + Array.wrap(options[:scope]).to_h do |scope_attribute| [scope_attribute, record.send(scope_attribute)] - end.to_h + end end end end From cbea9cea9856e097c252adba723aaf0aecfdd949 Mon Sep 17 00:00:00 2001 From: Edu Saborit Date: Fri, 1 Mar 2024 20:49:30 +0100 Subject: [PATCH 2/5] Update docker command in README --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 1ce2736a..113a5ff9 100644 --- a/README.md +++ b/README.md @@ -73,7 +73,7 @@ KB.config.log_level = :debugger # :info by default - `referrals` - returns all the KB::Referral associated with this pet parent - `referrers` - - returns all the KB::Referral associated with any of the pet parent's pets + - returns all the KB::Referral associated with any of the pet parent's pets #### Assessment 📄 @@ -245,7 +245,7 @@ You should be able to use the API seemlessly and the calls to the API will be in ## Development & Testing ```bash -docker run -it --rm -v $(pwd):/app --workdir=/app ruby:2.7.2 bash +docker compose run --rm kb bash > bundle install > rspec ``` From e6545e8e01409e65ca91843cf54a43a9be00d168 Mon Sep 17 00:00:00 2001 From: Edu Saborit Date: Fri, 1 Mar 2024 20:37:06 +0100 Subject: [PATCH 3/5] Upgrade to Ruby 3.2.3 --- .ruby-version | 3 +-- docker-compose.yaml | 4 ++-- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/.ruby-version b/.ruby-version index 00c476cf..ab96aa90 100644 --- a/.ruby-version +++ b/.ruby-version @@ -1,2 +1 @@ -ruby-2.7.2 - +ruby-3.2.3 diff --git a/docker-compose.yaml b/docker-compose.yaml index cc905c72..ad12b369 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -1,12 +1,12 @@ version: "3.0" services: kb: - image: ruby:2.7.1-buster + image: ruby:3.2.3 working_dir: /app volumes: - .:/app - bundle:/usr/local/bundle - environment: + environment: - KB_API_URL_TEMPLATE=$KB_API_URL_TEMPLATE - KB_PARTNER_KEY=$KB_PARTNER_KEY - KB_API_KEY=$KB_API_KEY From fb091ea96663e7a722829a8711b99805dbdcfe11 Mon Sep 17 00:00:00 2001 From: Edu Saborit Date: Fri, 1 Mar 2024 20:53:47 +0100 Subject: [PATCH 4/5] Specify maximum Ruby version supported --- barkibu-kb-fake.gemspec | 2 +- barkibu-kb.gemspec | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/barkibu-kb-fake.gemspec b/barkibu-kb-fake.gemspec index 222e15a5..e09c9f46 100644 --- a/barkibu-kb-fake.gemspec +++ b/barkibu-kb-fake.gemspec @@ -32,7 +32,7 @@ Gem::Specification.new do |spec| spec.bindir = 'exe' spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) } spec.require_paths = ['lib'] - spec.required_ruby_version = '>= 2.6' + spec.required_ruby_version = '>= 2.6', '< 3.3' spec.add_runtime_dependency 'barkibu-kb', KB::VERSION spec.add_runtime_dependency 'countries' diff --git a/barkibu-kb.gemspec b/barkibu-kb.gemspec index 128ee893..6d46e8f3 100644 --- a/barkibu-kb.gemspec +++ b/barkibu-kb.gemspec @@ -34,7 +34,7 @@ Gem::Specification.new do |spec| spec.bindir = 'exe' spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) } spec.require_paths = ['lib'] - spec.required_ruby_version = '>= 2.6' + spec.required_ruby_version = '>= 2.6', '< 3.3' spec.add_dependency 'dry-configurable', '~> 0.9' spec.add_development_dependency 'bundler' From 627a3d101c2566baf8dca87da656eafa909729b4 Mon Sep 17 00:00:00 2001 From: Edu Saborit Date: Fri, 1 Mar 2024 20:41:44 +0100 Subject: [PATCH 5/5] Bump version --- CHANGELOG.md | 5 ++++- Gemfile.lock | 6 +++--- lib/kb/version.rb | 2 +- 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index aeb9e14f..43311e7c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,7 +6,10 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). ## [unreleased] -- See diff: https://github.com/barkibu/kb-ruby/compare/v0.24.1...HEAD +- See diff: https://github.com/barkibu/kb-ruby/compare/v0.25...HEAD + +# [0.25.0] +- Add support for Ruby 3.2 # [0.24.1] - Add support for `.referrers` method on `PetParent` in fake model diff --git a/Gemfile.lock b/Gemfile.lock index b423797c..78781979 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,7 +1,7 @@ PATH remote: . specs: - barkibu-kb (0.24.1) + barkibu-kb (0.25.0) activemodel (>= 4.0.2) activerecord activesupport (>= 3.0.0) @@ -10,8 +10,8 @@ PATH faraday-http faraday_middleware i18n - barkibu-kb-fake (0.24.1) - barkibu-kb (= 0.24.1) + barkibu-kb-fake (0.25.0) + barkibu-kb (= 0.25.0) countries sinatra webmock diff --git a/lib/kb/version.rb b/lib/kb/version.rb index 343e1fec..d35ba1a5 100644 --- a/lib/kb/version.rb +++ b/lib/kb/version.rb @@ -1,3 +1,3 @@ module KB - VERSION = '0.24.1'.freeze + VERSION = '0.25.0'.freeze end