Skip to content

Commit 43f82c9

Browse files
committed
Update to Rails 8.1 and Ruby 3.4
* Use ruby:3.4-slim as the base Docker image. * Update application configurations for Rails 8.1. * `rails app:update` automatically updated `public/` HTML files. * Update specs to conform with new Rubocop. Closes: AP-760
1 parent 9bd84c6 commit 43f82c9

38 files changed

Lines changed: 1606 additions & 339 deletions

.idea/jsLibraryMappings.xml

Lines changed: 937 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.rubocop.yml

Lines changed: 155 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
1-
plugins: rubocop-rails
1+
plugins:
2+
- rubocop-rails
3+
- rubocop-rspec
4+
- rubocop-rspec_rails
25

36
AllCops:
47
UseCache: false
@@ -294,6 +297,8 @@ Rails/NegateInclude: # new in 2.7
294297
Enabled: true
295298
Rails/Pluck: # new in 2.7
296299
Enabled: true
300+
Exclude:
301+
- 'spec/**/*'
297302
Rails/PluckInWhere: # new in 2.7
298303
Enabled: true
299304
Rails/RenderInline: # new in 2.7
@@ -594,3 +599,152 @@ Rails/WhereNotWithMultipleConditions: # new in 2.17
594599
Enabled: true
595600
Rails/WhereRange: # new in 2.25
596601
Enabled: true
602+
RSpec/IncludeExamples: # new in 3.6
603+
Enabled: true
604+
RSpec/LeakyLocalVariable: # new in 3.8
605+
Enabled: true
606+
RSpecRails/HaveHttpStatus: # new in 2.12
607+
Enabled: true
608+
RSpecRails/MinitestAssertions: # new in 2.17
609+
Enabled: true
610+
RSpecRails/NegationBeValid: # new in 2.23
611+
Enabled: true
612+
RSpecRails/TravelAround: # new in 2.19
613+
Enabled: true
614+
615+
############################################################
616+
# rubocop-rspec
617+
618+
# believe me, it wasn't by choice
619+
RSpec/AnyInstance:
620+
Enabled: false
621+
622+
RSpec/VerifiedDoubleReference:
623+
Enabled: false
624+
625+
# we meant to do that
626+
RSpec/BeforeAfterAll:
627+
Enabled: false
628+
629+
RSpec/ContainExactly:
630+
Enabled: false
631+
632+
# more words != more readable
633+
RSpec/ContextWording:
634+
Enabled: false
635+
636+
# not everything we test is a class
637+
RSpec/DescribeClass:
638+
Enabled: false
639+
640+
# explicit >>> implicit
641+
RSpec/DescribedClass:
642+
Enabled: false
643+
644+
# more punctuation != more readable
645+
RSpec/DescribeSymbol:
646+
Enabled: false
647+
648+
# setup cost / time >>> failure granularity
649+
RSpec/ExampleLength:
650+
Max: 25
651+
CountAsOne:
652+
- array
653+
- hash
654+
- heredoc
655+
656+
# we meant to do that
657+
RSpec/ExpectInHook:
658+
Enabled: false
659+
660+
RSpec/SpecFilePathFormat:
661+
Enabled: false
662+
663+
RSpec/SpecFilePathSuffix:
664+
Enabled: false
665+
666+
# Requests are not inferred properly without explicit typing.
667+
# Similarly, system tests don't pick up Selenium without explicit typing.
668+
RSpecRails/InferredSpecType:
669+
Enabled: true
670+
Exclude:
671+
- 'spec/requests/*.rb'
672+
- 'spec/system/*.rb'
673+
674+
# explicit >>> implicit
675+
RSpec/InstanceVariable:
676+
Enabled: false
677+
678+
# maybe when 'all' has a corresponding 'none' matcher
679+
RSpec/IteratedExpectation:
680+
Enabled: false
681+
682+
# we meant to do that
683+
RSpec/MessageSpies:
684+
Enabled: false
685+
686+
# too late now
687+
RSpec/MultipleMemoizedHelpers:
688+
Enabled: false
689+
690+
# setup cost / time >>> failure granularity
691+
RSpec/MultipleExpectations:
692+
Enabled: false
693+
694+
# cure is worse than the disease
695+
RSpec/NestedGroups:
696+
Enabled: false
697+
698+
# more quotation marks != more readable
699+
RSpec/SharedExamples:
700+
Enabled: false
701+
702+
# we meant to do that
703+
RSpec/StubbedMock:
704+
Enabled: false
705+
706+
# we meant to do that
707+
RSpec/VerifiedDoubles:
708+
Enabled: false
709+
710+
############################################################
711+
# rubocop-rspec
712+
713+
# enable newer rubocop-rspec cops
714+
715+
RSpec/IdenticalEqualityAssertion: # new in 2.4
716+
Enabled: true
717+
718+
RSpecRails/AvoidSetupHook: # new in 2.4
719+
Enabled: true
720+
721+
# Sometimes we're testing the operator
722+
Lint/BinaryOperatorWithIdenticalOperands:
723+
Exclude:
724+
- 'spec/**/*'
725+
726+
Metrics/AbcSize:
727+
Exclude:
728+
- 'spec/**/*'
729+
730+
Metrics/BlockLength:
731+
Exclude:
732+
- 'spec/**/*'
733+
734+
Metrics/ModuleLength:
735+
Exclude:
736+
- 'spec/**/*'
737+
738+
Metrics/MethodLength:
739+
Exclude:
740+
- 'spec/**/*'
741+
742+
# we meant to do that
743+
Rails/SkipsModelValidations:
744+
Exclude:
745+
- 'spec/**/*'
746+
747+
# we meant to do that
748+
Rails/TimeZone:
749+
Exclude:
750+
- 'spec/**/*'

.yarnrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@
22
# yarn lockfile v1
33

44

5-
lastUpdateCheck 1780439312657
5+
lastUpdateCheck 1782867282598

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
# The base stage scaffolds elements which are common to building and running
55
# the application, such as installing ca-certificates, creating the app user,
66
# and installing runtime system dependencies.
7-
FROM ruby:3.3-slim AS base
7+
FROM ruby:3.4-slim AS base
88

99
# ------------------------------------------------------------
1010
# Declarative metadata

Gemfile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
source 'https://rubygems.org'
22
git_source(:github) { |repo| "https://github.com/#{repo}.git" }
33

4-
ruby '~> 3.3'
4+
ruby '~> 3.4'
55

66
gem 'addressable', '~> 2.8'
77
gem 'awesome_print', '~> 1.9'
@@ -28,14 +28,14 @@ gem 'pg', '~> 1.2'
2828
gem 'pg_search', '~> 2.3'
2929
gem 'puma', '~> 7.2'
3030
gem 'puma-plugin-delayed_stop', '~> 0.1.2'
31-
gem 'rails', '~> 8.0.5'
31+
gem 'rails', '~> 8.1.3'
3232
gem 'ruby-vips', '~> 2.3'
3333
gem 'sprockets-rails', '~> 3.5.0'
3434

3535
group :development, :test do
3636
gem 'brakeman'
3737
gem 'bundle-audit'
38-
gem 'byebug', platforms: %i[mri mingw x64_mingw]
38+
gem 'byebug', platforms: %i[mri windows]
3939
gem 'colorize'
4040
gem 'factory_bot_rails'
4141
gem 'rspec-rails', '~> 8.0'

0 commit comments

Comments
 (0)