Skip to content

Commit 1b05b5c

Browse files
authored
Merge pull request #1114 from texpert/housekeeping
Housekeeping: update Rails, Rubocop, and other gems, remove the Oj gem, fix Capybara::Screenshot settings
2 parents 8a4e506 + c16cdfb commit 1b05b5c

File tree

13 files changed

+90
-108
lines changed

13 files changed

+90
-108
lines changed

.rubocop.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
inherit_from: .rubocop_todo.yml
22

3-
require: rubocop-rspec
3+
plugins: rubocop-rspec
44

55
AllCops:
66
Exclude:

.rubocop_todo.yml

Lines changed: 12 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# This configuration was generated by
22
# `rubocop --auto-gen-config`
3-
# on 2024-06-11 17:08:27 UTC using RuboCop version 1.64.1.
3+
# on 2025-03-14 21:51:08 UTC using RuboCop version 1.74.0.
44
# The point is for the user to remove these configuration records
55
# one by one as the offenses are removed from the code base.
66
# Note that changes in the inspected code, or installation of new
@@ -30,10 +30,10 @@ Metrics/AbcSize:
3030
Metrics/BlockLength:
3131
Max: 125
3232

33-
# Offense count: 6
34-
# Configuration parameters: CountBlocks.
33+
# Offense count: 5
34+
# Configuration parameters: CountBlocks, CountModifierForms.
3535
Metrics/BlockNesting:
36-
Max: 5
36+
Max: 4
3737

3838
# Offense count: 21
3939
# Configuration parameters: CountComments, CountAsOne.
@@ -45,12 +45,12 @@ Metrics/ClassLength:
4545
Metrics/CyclomaticComplexity:
4646
Max: 62
4747

48-
# Offense count: 146
48+
# Offense count: 148
4949
# Configuration parameters: CountComments, CountAsOne, AllowedMethods, AllowedPatterns.
5050
Metrics/MethodLength:
5151
Max: 335
5252

53-
# Offense count: 9
53+
# Offense count: 10
5454
# Configuration parameters: CountComments, CountAsOne.
5555
Metrics/ModuleLength:
5656
Max: 340
@@ -61,7 +61,7 @@ Metrics/ParameterLists:
6161
MaxOptionalParameters: 7
6262
Max: 8
6363

64-
# Offense count: 46
64+
# Offense count: 47
6565
# Configuration parameters: AllowedMethods, AllowedPatterns.
6666
Metrics/PerceivedComplexity:
6767
Max: 63
@@ -117,7 +117,7 @@ Naming/MethodParameterName:
117117
- 'lib/plugin_routes.rb'
118118

119119
# Offense count: 22
120-
# Configuration parameters: NamePrefix, ForbiddenPrefixes, AllowedMethods, MethodDefinitionMacros.
120+
# Configuration parameters: NamePrefix, ForbiddenPrefixes, AllowedMethods, MethodDefinitionMacros, UseSorbetSigs.
121121
# NamePrefix: is_, has_, have_
122122
# ForbiddenPrefixes: is_, has_, have_
123123
# AllowedMethods: is_a?
@@ -139,7 +139,7 @@ Naming/PredicateName:
139139
# Offense count: 5
140140
# Configuration parameters: EnforcedStyle, CheckMethodNames, CheckSymbols, AllowedIdentifiers, AllowedPatterns.
141141
# SupportedStyles: snake_case, normalcase, non_integer
142-
# AllowedIdentifiers: capture3, iso8601, rfc1123_date, rfc822, rfc2822, rfc3339, x86_64
142+
# AllowedIdentifiers: TLS1_1, TLS1_2, capture3, iso8601, rfc1123_date, rfc822, rfc2822, rfc3339, x86_64
143143
Naming/VariableNumber:
144144
Exclude:
145145
- 'app/controllers/camaleon_cms/frontend_controller.rb'
@@ -176,15 +176,7 @@ Style/GlobalVars:
176176
- 'lib/tasks/camaleon_cms/camaleon_tasks.rake'
177177
- 'lib/tasks/camaleon_cms/rspec_test.rake'
178178

179-
# Offense count: 2
180-
# This cop supports safe autocorrection (--autocorrect).
181-
# Configuration parameters: MinBodyLength, AllowConsecutiveConditionals.
182-
Style/GuardClause:
183-
Exclude:
184-
- 'app/validators/camaleon_cms/post_uniq_validator.rb'
185-
- 'app/validators/camaleon_cms/uniq_validator.rb'
186-
187-
# Offense count: 32
179+
# Offense count: 30
188180
# This cop supports safe autocorrection (--autocorrect).
189181
Style/IfUnlessModifier:
190182
Exclude:
@@ -196,19 +188,16 @@ Style/IfUnlessModifier:
196188
- 'app/helpers/camaleon_cms/frontend/nav_menu_helper.rb'
197189
- 'app/helpers/camaleon_cms/site_helper.rb'
198190
- 'app/helpers/camaleon_cms/uploader_helper.rb'
199-
- 'app/validators/camaleon_cms/post_uniq_validator.rb'
200-
- 'app/validators/camaleon_cms/uniq_validator.rb'
201-
- 'config/initializers/sass.rb'
202191

203192
# Offense count: 37
204193
# Configuration parameters: AllowedMethods.
205194
# AllowedMethods: respond_to_missing?
206195
Style/OptionalBooleanParameter:
207196
Enabled: false
208197

209-
# Offense count: 252
198+
# Offense count: 241
210199
# This cop supports safe autocorrection (--autocorrect).
211-
# Configuration parameters: AllowHeredoc, AllowURI, URISchemes, IgnoreCopDirectives, AllowedPatterns.
200+
# Configuration parameters: AllowHeredoc, AllowURI, URISchemes, IgnoreCopDirectives, AllowedPatterns, SplitStrings.
212201
# URISchemes: http, https
213202
Layout/LineLength:
214203
Max: 2326

Gemfile

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ source 'https://rubygems.org'
22

33
gemspec
44
gem 'non-digest-assets', '2.5.0'
5-
gem 'oj'
65
gem 'rails', '~> 8.0.1'
76
gem 'selenium-webdriver', '4.23.0'
87
gem 'sprockets-rails', '>= 3.5.2'

Gemfile.lock

Lines changed: 65 additions & 70 deletions
Original file line numberDiff line numberDiff line change
@@ -25,69 +25,69 @@ PATH
2525
GEM
2626
remote: https://rubygems.org/
2727
specs:
28-
actioncable (8.0.1)
29-
actionpack (= 8.0.1)
30-
activesupport (= 8.0.1)
28+
actioncable (8.0.2)
29+
actionpack (= 8.0.2)
30+
activesupport (= 8.0.2)
3131
nio4r (~> 2.0)
3232
websocket-driver (>= 0.6.1)
3333
zeitwerk (~> 2.6)
34-
actionmailbox (8.0.1)
35-
actionpack (= 8.0.1)
36-
activejob (= 8.0.1)
37-
activerecord (= 8.0.1)
38-
activestorage (= 8.0.1)
39-
activesupport (= 8.0.1)
34+
actionmailbox (8.0.2)
35+
actionpack (= 8.0.2)
36+
activejob (= 8.0.2)
37+
activerecord (= 8.0.2)
38+
activestorage (= 8.0.2)
39+
activesupport (= 8.0.2)
4040
mail (>= 2.8.0)
41-
actionmailer (8.0.1)
42-
actionpack (= 8.0.1)
43-
actionview (= 8.0.1)
44-
activejob (= 8.0.1)
45-
activesupport (= 8.0.1)
41+
actionmailer (8.0.2)
42+
actionpack (= 8.0.2)
43+
actionview (= 8.0.2)
44+
activejob (= 8.0.2)
45+
activesupport (= 8.0.2)
4646
mail (>= 2.8.0)
4747
rails-dom-testing (~> 2.2)
48-
actionpack (8.0.1)
49-
actionview (= 8.0.1)
50-
activesupport (= 8.0.1)
48+
actionpack (8.0.2)
49+
actionview (= 8.0.2)
50+
activesupport (= 8.0.2)
5151
nokogiri (>= 1.8.5)
5252
rack (>= 2.2.4)
5353
rack-session (>= 1.0.1)
5454
rack-test (>= 0.6.3)
5555
rails-dom-testing (~> 2.2)
5656
rails-html-sanitizer (~> 1.6)
5757
useragent (~> 0.16)
58-
actiontext (8.0.1)
59-
actionpack (= 8.0.1)
60-
activerecord (= 8.0.1)
61-
activestorage (= 8.0.1)
62-
activesupport (= 8.0.1)
58+
actiontext (8.0.2)
59+
actionpack (= 8.0.2)
60+
activerecord (= 8.0.2)
61+
activestorage (= 8.0.2)
62+
activesupport (= 8.0.2)
6363
globalid (>= 0.6.0)
6464
nokogiri (>= 1.8.5)
65-
actionview (8.0.1)
66-
activesupport (= 8.0.1)
65+
actionview (8.0.2)
66+
activesupport (= 8.0.2)
6767
builder (~> 3.1)
6868
erubi (~> 1.11)
6969
rails-dom-testing (~> 2.2)
7070
rails-html-sanitizer (~> 1.6)
71-
activejob (8.0.1)
72-
activesupport (= 8.0.1)
71+
activejob (8.0.2)
72+
activesupport (= 8.0.2)
7373
globalid (>= 0.3.6)
74-
activemodel (8.0.1)
75-
activesupport (= 8.0.1)
74+
activemodel (8.0.2)
75+
activesupport (= 8.0.2)
7676
activemodel-serializers-xml (1.0.3)
7777
activemodel (>= 5.0.0.a)
7878
activesupport (>= 5.0.0.a)
7979
builder (~> 3.1)
80-
activerecord (8.0.1)
81-
activemodel (= 8.0.1)
82-
activesupport (= 8.0.1)
80+
activerecord (8.0.2)
81+
activemodel (= 8.0.2)
82+
activesupport (= 8.0.2)
8383
timeout (>= 0.4.0)
84-
activestorage (8.0.1)
85-
actionpack (= 8.0.1)
86-
activejob (= 8.0.1)
87-
activerecord (= 8.0.1)
88-
activesupport (= 8.0.1)
84+
activestorage (8.0.2)
85+
actionpack (= 8.0.2)
86+
activejob (= 8.0.2)
87+
activerecord (= 8.0.2)
88+
activesupport (= 8.0.2)
8989
marcel (~> 1.0)
90-
activesupport (8.0.1)
90+
activesupport (8.0.2)
9191
base64
9292
benchmark (>= 0.3)
9393
bigdecimal
@@ -103,9 +103,9 @@ GEM
103103
addressable (2.8.7)
104104
public_suffix (>= 2.0.2, < 7.0)
105105
ast (2.4.2)
106-
aws-eventstream (1.3.1)
107-
aws-partitions (1.1054.0)
108-
aws-sdk-core (3.219.0)
106+
aws-eventstream (1.3.2)
107+
aws-partitions (1.1067.0)
108+
aws-sdk-core (3.220.1)
109109
aws-eventstream (~> 1, >= 1.3.0)
110110
aws-partitions (~> 1, >= 1.992.0)
111111
aws-sigv4 (~> 1.9)
@@ -183,7 +183,7 @@ GEM
183183
railties (>= 3.2, < 9.0)
184184
globalid (1.2.1)
185185
activesupport (>= 6.1)
186-
google-protobuf (4.29.3-x86_64-darwin)
186+
google-protobuf (4.30.1-x86_64-darwin)
187187
bigdecimal
188188
rake (>= 13)
189189
i18n (1.14.7)
@@ -200,7 +200,7 @@ GEM
200200
rails-dom-testing (>= 1, < 3)
201201
railties (>= 4.2.0)
202202
thor (>= 0.14, < 2.0)
203-
json (2.10.1)
203+
json (2.10.2)
204204
language_server-protocol (3.17.0.4)
205205
launchy (3.1.1)
206206
addressable (~> 2.8)
@@ -225,7 +225,7 @@ GEM
225225
benchmark
226226
logger
227227
mini_mime (1.1.5)
228-
minitest (5.25.4)
228+
minitest (5.25.5)
229229
net-imap (0.5.6)
230230
date
231231
net-protocol
@@ -236,15 +236,11 @@ GEM
236236
net-smtp (0.5.1)
237237
net-protocol
238238
nio4r (2.7.4)
239-
nokogiri (1.18.3-x86_64-darwin)
239+
nokogiri (1.18.4-x86_64-darwin)
240240
racc (~> 1.4)
241241
non-digest-assets (2.5.0)
242242
activesupport (>= 6.0, < 8.1)
243243
sprockets (~> 4.0)
244-
oj (3.16.9)
245-
bigdecimal (>= 3.0)
246-
ostruct (>= 0.2)
247-
ostruct (0.6.1)
248244
parallel (1.26.3)
249245
parser (3.3.7.1)
250246
ast (~> 2.4.1)
@@ -268,7 +264,7 @@ GEM
268264
puma (6.6.0)
269265
nio4r (~> 2.0)
270266
racc (1.8.1)
271-
rack (3.1.10)
267+
rack (3.1.12)
272268
rack-session (2.1.0)
273269
base64 (>= 0.1.0)
274270
rack (>= 3.0.0)
@@ -279,30 +275,30 @@ GEM
279275
rack (>= 1.0.0)
280276
rackup (2.2.1)
281277
rack (>= 3)
282-
rails (8.0.1)
283-
actioncable (= 8.0.1)
284-
actionmailbox (= 8.0.1)
285-
actionmailer (= 8.0.1)
286-
actionpack (= 8.0.1)
287-
actiontext (= 8.0.1)
288-
actionview (= 8.0.1)
289-
activejob (= 8.0.1)
290-
activemodel (= 8.0.1)
291-
activerecord (= 8.0.1)
292-
activestorage (= 8.0.1)
293-
activesupport (= 8.0.1)
278+
rails (8.0.2)
279+
actioncable (= 8.0.2)
280+
actionmailbox (= 8.0.2)
281+
actionmailer (= 8.0.2)
282+
actionpack (= 8.0.2)
283+
actiontext (= 8.0.2)
284+
actionview (= 8.0.2)
285+
activejob (= 8.0.2)
286+
activemodel (= 8.0.2)
287+
activerecord (= 8.0.2)
288+
activestorage (= 8.0.2)
289+
activesupport (= 8.0.2)
294290
bundler (>= 1.15.0)
295-
railties (= 8.0.1)
291+
railties (= 8.0.2)
296292
rails-dom-testing (2.2.0)
297293
activesupport (>= 5.0.0)
298294
minitest
299295
nokogiri (>= 1.6)
300296
rails-html-sanitizer (1.6.2)
301297
loofah (~> 2.21)
302298
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)
303-
railties (8.0.1)
304-
actionpack (= 8.0.1)
305-
activesupport (= 8.0.1)
299+
railties (8.0.2)
300+
actionpack (= 8.0.2)
301+
activesupport (= 8.0.2)
306302
irb (~> 1.13)
307303
rackup (>= 1.0.0)
308304
rake (>= 12.2)
@@ -344,7 +340,7 @@ GEM
344340
rspec-support (3.13.2)
345341
rspec_junit_formatter (0.6.0)
346342
rspec-core (>= 2, < 4, != 2.12.0)
347-
rubocop (1.72.2)
343+
rubocop (1.74.0)
348344
json (~> 2.3)
349345
language_server-protocol (~> 3.17.0.2)
350346
lint_roller (~> 1.1.0)
@@ -355,15 +351,15 @@ GEM
355351
rubocop-ast (>= 1.38.0, < 2.0)
356352
ruby-progressbar (~> 1.7)
357353
unicode-display_width (>= 2.4.0, < 4.0)
358-
rubocop-ast (1.38.0)
354+
rubocop-ast (1.38.1)
359355
parser (>= 3.3.1.0)
360356
rubocop-rspec (3.5.0)
361357
lint_roller (~> 1.1)
362358
rubocop (~> 1.72, >= 1.72.1)
363359
ruby-progressbar (1.13.0)
364360
ruby2_keywords (0.0.5)
365361
rubyzip (2.4.1)
366-
sass-embedded (1.85.0-x86_64-darwin)
362+
sass-embedded (1.85.1-x86_64-darwin)
367363
google-protobuf (~> 4.29)
368364
sassc-embedded (1.80.4)
369365
sass-embedded (~> 1.80)
@@ -393,7 +389,7 @@ GEM
393389
unicode-display_width (3.1.4)
394390
unicode-emoji (~> 4.0, >= 4.0.4)
395391
unicode-emoji (4.0.4)
396-
uri (1.0.2)
392+
uri (1.0.3)
397393
useragent (0.16.11)
398394
websocket (1.2.11)
399395
websocket-driver (0.7.7)
@@ -418,7 +414,6 @@ DEPENDENCIES
418414
factory_bot_rails
419415
faker
420416
non-digest-assets (= 2.5.0)
421-
oj
422417
pry-rescue
423418
pry-stack_explorer
424419
puma

app/validators/camaleon_cms/post_uniq_validator.rb

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,11 @@ def validate(record)
2828
end
2929

3030
# avoid recursive page parent
31-
if record.post_parent.present? && ptype.manage_hierarchy? && record.parents.cama_pluck(:id).include?(record.id)
32-
record.errors[:base] << I18n.t('camaleon_cms.admin.post.message.recursive_hierarchy',
33-
default: 'Parent Post Recursive')
34-
end
31+
return unless record.post_parent.present? && ptype.manage_hierarchy? &&
32+
record.parents.cama_pluck(:id).include?(record.id)
33+
34+
record.errors[:base] << I18n.t('camaleon_cms.admin.post.message.recursive_hierarchy',
35+
default: 'Parent Post Recursive')
3536
end
3637
end
3738
end

0 commit comments

Comments
 (0)