Skip to content

Commit

Permalink
Merge pull request #90 from barkibu/ruby3
Browse files Browse the repository at this point in the history
Support Ruby 3.2
  • Loading branch information
esaborit4code authored Mar 21, 2024
2 parents 883763b + 627a3d1 commit 6b0f7aa
Show file tree
Hide file tree
Showing 10 changed files with 34 additions and 27 deletions.
3 changes: 3 additions & 0 deletions .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@
#
require: rubocop-rspec

Gemspec/RequireMFA:
Enabled: false

AllCops:
TargetRubyVersion: 2.6.5
NewCops: enable
Expand Down
3 changes: 1 addition & 2 deletions .ruby-version
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
ruby-2.7.2

ruby-3.2.3
5 changes: 4 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
32 changes: 17 additions & 15 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -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)
Expand All @@ -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
Expand Down Expand Up @@ -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)
Expand All @@ -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)
Expand All @@ -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)
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 📄

Expand Down Expand Up @@ -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
```
Expand Down
2 changes: 1 addition & 1 deletion barkibu-kb-fake.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down
2 changes: 1 addition & 1 deletion barkibu-kb.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down
4 changes: 2 additions & 2 deletions docker-compose.yaml
Original file line number Diff line number Diff line change
@@ -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
Expand Down
4 changes: 2 additions & 2 deletions lib/kb/validators/uniqueness_validator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 1 addition & 1 deletion lib/kb/version.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
module KB
VERSION = '0.24.1'.freeze
VERSION = '0.25.0'.freeze
end

0 comments on commit 6b0f7aa

Please sign in to comment.