Skip to content

Commit 2f96a50

Browse files
Drop Ruby < 3.2 and Rails < 7.2 support
Update standardb and resolve lint issues
1 parent 5e72502 commit 2f96a50

File tree

9 files changed

+97
-61
lines changed

9 files changed

+97
-61
lines changed

.github/workflows/spec.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ jobs:
1111
runs-on: ubuntu-latest
1212
strategy:
1313
matrix:
14-
ruby: ['2.5', '2.6', '2.7', '3.0', '3.1']
14+
ruby: ['3.2', '3.3', '3.4']
1515

1616
steps:
1717
- uses: actions/checkout@v2

.ruby-version

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
3.1.0
1+
3.4.5

Gemfile.lock

Lines changed: 80 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -2,41 +2,55 @@ PATH
22
remote: .
33
specs:
44
jsonapi-query_builder (0.3.0)
5-
activerecord (>= 5)
5+
activerecord (>= 7.2)
66
pagy (>= 3.5)
77

88
GEM
99
remote: https://rubygems.org/
1010
specs:
11-
actionview (6.1.7.10)
12-
activesupport (= 6.1.7.10)
11+
actionview (8.0.2.1)
12+
activesupport (= 8.0.2.1)
1313
builder (~> 3.1)
14-
erubi (~> 1.4)
15-
rails-dom-testing (~> 2.0)
16-
rails-html-sanitizer (~> 1.1, >= 1.2.0)
17-
activemodel (6.1.7.10)
18-
activesupport (= 6.1.7.10)
19-
activerecord (6.1.7.10)
20-
activemodel (= 6.1.7.10)
21-
activesupport (= 6.1.7.10)
22-
activesupport (6.1.7.10)
23-
concurrent-ruby (~> 1.0, >= 1.0.2)
14+
erubi (~> 1.11)
15+
rails-dom-testing (~> 2.2)
16+
rails-html-sanitizer (~> 1.6)
17+
activemodel (8.0.2.1)
18+
activesupport (= 8.0.2.1)
19+
activerecord (8.0.2.1)
20+
activemodel (= 8.0.2.1)
21+
activesupport (= 8.0.2.1)
22+
timeout (>= 0.4.0)
23+
activesupport (8.0.2.1)
24+
base64
25+
benchmark (>= 0.3)
26+
bigdecimal
27+
concurrent-ruby (~> 1.0, >= 1.3.1)
28+
connection_pool (>= 2.2.5)
29+
drb
2430
i18n (>= 1.6, < 2)
31+
logger (>= 1.4.2)
2532
minitest (>= 5.1)
26-
tzinfo (~> 2.0)
27-
zeitwerk (~> 2.3)
33+
securerandom (>= 0.3)
34+
tzinfo (~> 2.0, >= 2.0.5)
35+
uri (>= 0.13.1)
2836
ast (2.4.2)
37+
base64 (0.3.0)
38+
benchmark (0.4.1)
39+
bigdecimal (3.2.3)
2940
builder (3.2.4)
3041
bundler-audit (0.9.0.1)
3142
bundler (>= 1.2.0, < 3)
3243
thor (~> 1.0)
3344
coderay (1.1.3)
34-
concurrent-ruby (1.1.9)
45+
concurrent-ruby (1.3.5)
46+
connection_pool (2.5.4)
3547
crass (1.0.6)
3648
diff-lcs (1.4.4)
37-
erubi (1.10.0)
49+
drb (2.2.3)
50+
erubi (1.13.1)
3851
i18n (1.8.10)
3952
concurrent-ruby (~> 1.0)
53+
json (2.13.2)
4054
kaminari (1.2.1)
4155
activesupport (>= 4.1.0)
4256
kaminari-actionview (= 1.2.1)
@@ -49,7 +63,10 @@ GEM
4963
activerecord
5064
kaminari-core (= 1.2.1)
5165
kaminari-core (1.2.1)
66+
language_server-protocol (3.17.0.5)
5267
lefthook (0.7.6)
68+
lint_roller (1.1.0)
69+
logger (1.7.0)
5370
loofah (2.24.1)
5471
crass (~> 1.0.2)
5572
nokogiri (>= 1.12.0)
@@ -61,21 +78,24 @@ GEM
6178
racc (~> 1.4)
6279
pagy (3.11.0)
6380
parallel (1.21.0)
64-
parser (3.0.2.0)
81+
parser (3.3.9.0)
6582
ast (~> 2.4.1)
83+
racc
84+
prism (1.4.0)
6685
pry (0.14.1)
6786
coderay (~> 1.1)
6887
method_source (~> 1.0)
6988
racc (1.5.2)
70-
rails-dom-testing (2.0.3)
71-
activesupport (>= 4.2.0)
89+
rails-dom-testing (2.3.0)
90+
activesupport (>= 5.0.0)
91+
minitest
7292
nokogiri (>= 1.6)
73-
rails-html-sanitizer (1.5.0)
74-
loofah (~> 2.19, >= 2.19.1)
93+
rails-html-sanitizer (1.6.2)
94+
loofah (~> 2.21)
95+
nokogiri (>= 1.15.7, != 1.16.7, != 1.16.6, != 1.16.5, != 1.16.4, != 1.16.3, != 1.16.2, != 1.16.1, != 1.16.0.rc1, != 1.16.0)
7596
rainbow (3.0.0)
7697
rake (13.0.6)
77-
regexp_parser (2.1.1)
78-
rexml (3.4.1)
98+
regexp_parser (2.11.2)
7999
rspec (3.10.0)
80100
rspec-core (~> 3.10.0)
81101
rspec-expectations (~> 3.10.0)
@@ -89,35 +109,52 @@ GEM
89109
diff-lcs (>= 1.2.0, < 2.0)
90110
rspec-support (~> 3.10.0)
91111
rspec-support (3.10.2)
92-
rubocop (1.20.0)
112+
rubocop (1.80.2)
113+
json (~> 2.3)
114+
language_server-protocol (~> 3.17.0.2)
115+
lint_roller (~> 1.1.0)
93116
parallel (~> 1.10)
94-
parser (>= 3.0.0.0)
117+
parser (>= 3.3.0.2)
95118
rainbow (>= 2.2.2, < 4.0)
96-
regexp_parser (>= 1.8, < 3.0)
97-
rexml
98-
rubocop-ast (>= 1.9.1, < 2.0)
119+
regexp_parser (>= 2.9.3, < 3.0)
120+
rubocop-ast (>= 1.46.0, < 2.0)
99121
ruby-progressbar (~> 1.7)
100-
unicode-display_width (>= 1.4.0, < 3.0)
101-
rubocop-ast (1.12.0)
102-
parser (>= 3.0.1.1)
103-
rubocop-performance (1.11.5)
104-
rubocop (>= 1.7.0, < 2.0)
105-
rubocop-ast (>= 0.4.0)
122+
unicode-display_width (>= 2.4.0, < 4.0)
123+
rubocop-ast (1.46.0)
124+
parser (>= 3.3.7.2)
125+
prism (~> 1.4)
126+
rubocop-performance (1.25.0)
127+
lint_roller (~> 1.1)
128+
rubocop (>= 1.75.0, < 2.0)
129+
rubocop-ast (>= 1.38.0, < 2.0)
106130
rubocop-rspec (2.5.0)
107131
rubocop (~> 1.19)
108132
ruby-progressbar (1.11.0)
109-
sqlite3 (1.7.3)
133+
securerandom (0.4.1)
134+
sqlite3 (2.7.3)
110135
mini_portile2 (~> 2.8.0)
111-
standard (1.3.0)
112-
rubocop (= 1.20.0)
113-
rubocop-performance (= 1.11.5)
136+
standard (1.51.0)
137+
language_server-protocol (~> 3.17.0.2)
138+
lint_roller (~> 1.0)
139+
rubocop (~> 1.80.2)
140+
standard-custom (~> 1.0.0)
141+
standard-performance (~> 1.8)
142+
standard-custom (1.0.2)
143+
lint_roller (~> 1.0)
144+
rubocop (~> 1.50)
145+
standard-performance (1.8.0)
146+
lint_roller (~> 1.1)
147+
rubocop-performance (~> 1.25.0)
114148
standardrb (1.0.0)
115149
standard
116150
thor (1.4.0)
117-
tzinfo (2.0.4)
151+
timeout (0.4.3)
152+
tzinfo (2.0.6)
118153
concurrent-ruby (~> 1.0)
119-
unicode-display_width (2.1.0)
120-
zeitwerk (2.4.2)
154+
unicode-display_width (3.2.0)
155+
unicode-emoji (~> 4.1)
156+
unicode-emoji (4.1.0)
157+
uri (1.0.3)
121158

122159
PLATFORMS
123160
ruby
@@ -138,4 +175,4 @@ DEPENDENCIES
138175
standardrb
139176

140177
BUNDLED WITH
141-
2.2.22
178+
2.7.2

jsonapi-query_builder.gemspec

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,9 @@ Gem::Specification.new do |spec|
3636
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
3737
spec.require_paths = ["lib"]
3838

39-
spec.required_ruby_version = ">= 2.5"
39+
spec.required_ruby_version = ">= 3.2"
4040

41-
spec.add_runtime_dependency "activerecord", ">= 5"
41+
spec.add_runtime_dependency "activerecord", ">= 7.2"
4242
spec.add_runtime_dependency "pagy", ">= 3.5"
4343

4444
spec.add_development_dependency "bundler", "~> 2.0"

lefthook.yml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ lint:
22
commands: &lint
33
lint-frozen-strings:
44
glob: "*.rb"
5-
run: bundle exec rubocop --only Style/FrozenStringLiteralComment,Layout/EmptyLineAfterMagicComment --format quiet --auto-correct
5+
run: bundle exec rubocop --only Style/FrozenStringLiteralComment,Layout/EmptyLineAfterMagicComment --format quiet --autocorrect
66

77
rubocop:
88
commands: &rubocop
@@ -13,8 +13,7 @@ rubocop:
1313
pre-commit:
1414
parallel: true
1515
commands:
16-
<<: *lint
17-
<<: *rubocop
16+
<<: [*lint, *rubocop]
1817
standardrb:
1918
glob: "*.rb"
2019
run: bundle exec standardrb {staged_files}

lib/jsonapi/query_builder/errors/unpermitted_sort_parameters.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,11 @@ module QueryBuilder
55
module Errors
66
class UnpermittedSortParameters < ArgumentError
77
def initialize(unpermitted_parameters)
8-
super [
8+
super([
99
unpermitted_parameters.to_sentence,
10-
unpermitted_parameters.count == 1 ? "is not a" : "are not",
10+
(unpermitted_parameters.count == 1) ? "is not a" : "are not",
1111
"permitted sort attribute".pluralize(unpermitted_parameters.count)
12-
].join(" ")
12+
].join(" "))
1313
end
1414
end
1515
end

lib/jsonapi/query_builder/paginator/pagy.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ def paginate(page_params)
1313
@params = {page: page_params}
1414

1515
pagination_details, records = pagy collection, page: page_params[:number],
16-
items: page_params[:size],
17-
outset: page_params[:offset]
16+
items: page_params[:size],
17+
outset: page_params[:offset]
1818
[records, pagination_details]
1919
end
2020

spec/jsonapi/query_builder/mixins/sort_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@
9393
unique_sort_attribute id: :asc
9494
sorts_by :last_name
9595
sorts_by :first_name, ->(collection, direction) { collection.order(name: direction) }
96-
sorts_by :'address.street', StreetSort
96+
sorts_by :"address.street", StreetSort
9797

9898
def initialize(collection, params)
9999
@collection = collection

spec/jsonapi/query_builder/paginator/kaminari_spec.rb

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,11 @@
99
let(:collection) { instance_double "collection" }
1010
let(:paged_collection) do
1111
instance_double "paged-collection", current_page: 2,
12-
limit_value: 20,
13-
total_count: 35,
14-
total_pages: 2,
15-
next_page: nil,
16-
prev_page: 1
12+
limit_value: 20,
13+
total_count: 35,
14+
total_pages: 2,
15+
next_page: nil,
16+
prev_page: 1
1717
end
1818

1919
before do

0 commit comments

Comments
 (0)