Skip to content

Commit

Permalink
Merge pull request #344 from Mate2xo/rails_upgrade
Browse files Browse the repository at this point in the history
Rails 6.0 upgrade
  • Loading branch information
Mate2xo authored Sep 16, 2024
2 parents 679d271 + 9e5faf8 commit 2e58340
Show file tree
Hide file tree
Showing 124 changed files with 1,930 additions and 1,279 deletions.
6 changes: 4 additions & 2 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -1,17 +1,19 @@
version: 2 # use CircleCI 2.0
# NOTE: images have been migrated to 'next-gen'
# see: https://discuss.circleci.com/t/legacy-convenience-image-deprecation/41034
jobs: # a collection of steps
build: # runs not using Workflows must have a `build` job as entry point
parallelism: 3 # run three instances of this job in parallel
docker: # run the steps with Docker
- image: circleci/ruby:2.6.9-node-browsers # ...with this image as the primary container; this is where all `steps` will run
- image: cimg/ruby:2.7.8-browsers # ...with this image as the primary container; this is where all `steps` will run
environment: # environment variables for primary container
BUNDLE_JOBS: 3
BUNDLE_RETRY: 3
BUNDLE_PATH: vendor/bundle
PGHOST: 127.0.0.1
PGUSER: postgres
RAILS_ENV: test
- image: circleci/postgres:9.5-alpine # database image
- image: cimg/postgres:14.12 # database image
steps: # a collection of executable commands
- checkout # special step to check out source code to working directory

Expand Down
54 changes: 44 additions & 10 deletions .rubocop.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
require:
- rubocop-rspec
require:
- rubocop-rails
- rubocop-rspec
- rubocop-factory_bot
- rubocop-capybara
- rubocop-performance

inherit_gem:
# pundit: config/rubocop-rspec.yml

AllCops:
DisplayStyleGuide: true
Expand All @@ -13,7 +19,8 @@ AllCops:

Layout/LineLength:
Max: 120

Layout/SpaceInsideHashLiteralBraces:
EnforcedStyle: no_space
Lint/RedundantCopDisableDirective:
Enabled: false

Expand All @@ -23,15 +30,20 @@ Metrics/BlockLength:
- 'test/**/*.rb'
- 'Guardfile'
- 'vendor/bundle'
- 'app/admin/productors.rb'
# - "app/admin/**/*"
- 'config/environments/*.rb'
# - "app/views/admin/**/*"

Layout/SpaceAroundMethodCallOperator:
Enabled: true
Lint/RaiseException:
Enabled: true
Lint/StructNewOverride:
Enabled: true
Metrics/MethodLength:
Exclude:
- 'db/migrate/**/*'
- 'spec/**/*'

Style/Documentation:
Exclude:
- 'app/controllers/**/*'
Include:
- 'app/controllers/concerns/**/*'
Style/ExponentialNotation:
Enabled: true
Style/HashEachMethods:
Expand All @@ -40,6 +52,28 @@ Style/HashTransformKeys:
Enabled: true
Style/HashTransformValues:
Enabled: true
Style/SingleLineDoEndBlock:
Enabled: false
Style/StringLiterals:
Exclude:
- db/schema.rb

# ----------- Extensions overrides -----------
Rails/UnknownEnv:
Environments:
- development
- production
- staging
- test

RSpec/NestedGroups:
AllowedGroups: [describe]
Max: 3

RSpec/ExampleLength:
Exclude:
- 'spec/system/**/*'

# Personal taste
Naming/MemoizedInstanceVariableName:
EnforcedStyleForLeadingUnderscores: required
2 changes: 1 addition & 1 deletion .ruby-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
ruby-2.6.9
ruby-2.7.8
27 changes: 18 additions & 9 deletions .solargraph.yml
Original file line number Diff line number Diff line change
@@ -1,17 +1,26 @@
---
include:
- "**/*.rb"
- '**/*.rb'
exclude:
- spec/**/*
- test/**/*
- vendor/**/*
- ".bundle/**/*"
- spec/**/*
- test/**/*
- vendor/**/*
- '.bundle/**/*'
require: []
domains: []
reporters:
- rubocop
- require_not_found
- typecheck
- rubocop
- require_not_found
- typecheck:typed
# - reek
require_paths: []
plugins: []
formatter:
rubocop:
cops: safe
except: []
only: []
extra_args: []
plugins:
- solargraph-rails
- solargraph-reek
max_files: 5000
55 changes: 26 additions & 29 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
source 'https://rubygems.org'
git_source(:github) { |repo| "https://github.com/#{repo}.git" }

ruby '2.6.9'
ruby '2.7.8'

# Rails base gems
gem 'bootstrap', '~> 4.3.1'
Expand All @@ -12,27 +12,27 @@ gem 'jbuilder', '~> 2.5'
gem 'jquery-rails'
gem 'pg', '>= 0.18', '< 2.0'
gem 'puma', '~> 4.3'
gem 'rails', '~> 5.2.5'
gem 'rails', '~> 6.0.6'
gem 'sass-rails', '~> 5.0'
gem 'turbolinks', '~> 5'
gem 'uglifier', '>= 1.3.0'

# Reduces boot times through caching; required in config/boot.rb
gem 'bootsnap', '>= 1.1.0', require: false
gem 'bootsnap', '~> 1.18.0', require: false

# See https://github.com/rails/execjs#readme for more supported runtimes
# gem 'mini_racer', platforms: :ruby
gem 'mini_racer', platforms: :ruby
# Use Redis adapter to run Action Cable in production
gem 'redis', '~> 4.0'
gem 'redis', '~> 5.0'
# Use ActiveModel has_secure_password
# gem 'bcrypt', '~> 3.1.7'
# Use Capistrano for deployment
# gem 'capistrano-rails', group: :development

gem 'mini_magick', '~> 4.9.5' # Use ActiveStorage variant
gem 'mini_magick', '~> 4.13' # Use ActiveStorage variant

gem 'activeadmin' # Admin interface
gem 'active_storage_validations'
gem 'activeadmin', '~> 2.9.0' # NOTE: update-me to 2.11+ when upgrading to Rails 7
gem 'active_storage_validations', '~> 0.9' # NOTE: Update me to 1.1 when upgrading to Rails 7
gem 'addressable', '~> 2.8.0' # URI manipulations
gem 'aws-sdk-s3', '= 1.48', require: false # S3 file upload storage
gem 'bootstrap4-datetime-picker-rails'
Expand All @@ -45,47 +45,44 @@ gem 'enumerize'
gem 'httparty' # Http requests
gem 'ice_cube' # Calendar events recurrence (for Missions)
gem 'js_cookie_rails' # Cookie manager for js
gem 'leaflet-rails' # GeoMap generator
gem 'mailjet' # Production mailer API
gem 'pundit' # Authorization management
gem 'recurring_select' # Events recurrence rules set helper
gem 'thredded', '~> 0.16.16' # Forum engine
gem 'recurring_select', '~> 3.0' # Events recurrence rules set helper
gem 'thredded', '~> 1.0.0' # TODO: update me to 1.1 once upgraded to Rails 6

group :development, :test do
gem 'bullet'
gem 'factory_bot_rails', '~> 4.0'
gem 'faker' # Generate fake data for the seed.rb and spec factories
gem 'guard-rspec', require: false
gem 'pry-byebug', '~> 3.6'
gem 'rspec-rails', '~> 3.7', '>= 3.7.2'
gem 'bullet', '~> 7.1'
gem 'factory_bot_rails', '~> 6.4'
gem 'faker', '~> 3.3' # Generate fake data for the seed.rb and spec factories
gem 'pry-byebug', '~> 3.10'
gem 'rspec-rails', '~> 5.1'
end

group :development do
gem 'annotate', '~> 2.7', '>= 2.7.4'
gem 'letter_opener'
gem 'solargraph' # LSP provinding app documention through IDE
gem 'annotate', '~> 3.1'
gem 'letter_opener', '~> 1.8.0' # NOTE: Update me to 1.9 with Ruby3
gem 'solargraph', '~> 0.50' # LSP provinding app documention through IDE
# Access an interactive console on exception pages or by calling 'console' anywhere in the code.
gem 'listen', '>= 3.0.5', '< 3.2'
gem 'listen', '~> 3.9' # NOTE: Update me to 3.3 with Ruby3
gem 'rubocop', require: false
gem 'rubocop-rails', require: false
gem 'rubocop-rspec', require: false
gem 'web-console', '>= 3.3.0'
gem 'web-console', '~> 3.3' # NOTE: Update me to V4 with Rails6
# Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring
gem 'spring'
gem 'spring', '~> 3.1' # NOTE: Update me to v4 with Ruby3
gem 'spring-commands-rspec'
gem 'spring-watcher-listen', '~> 2.0.0'
# gem 'spring-watcher-listen', '~> 2.0.0' # NOTE: Update me to 2.1 with spring 4 on Ruby3
end

group :test do
gem 'email_spec'
# Adds support for Capybara system testing and selenium driver
gem 'capybara', '~> 3.21.0'
gem 'selenium-webdriver'
gem 'capybara', '~> 3.39.0' # NOTE: Update me when upgrading to Ruby3
# gem 'selenium-webdriver', '~> 4.11'
gem 'webdrivers' # NOTE: Delete this gem, & use selenium-webdriver 4.11+ when upgrading to Ruby3
# Easy installation and use of chromedriver to run system tests with Chrome
gem 'chromedriver-helper'
gem 'database_cleaner' # Easy database + association testing
gem 'rails-controller-testing' # If you are using Rails 5.x
gem 'shoulda-matchers', '4.0.0.rc1'
gem 'shoulda-matchers', '~> 5.3' # NOTE: Update me when ugrading to Rails6 and Ruby3
gem 'simplecov', require: false
end

Expand Down
Loading

0 comments on commit 2e58340

Please sign in to comment.