Skip to content

Commit

Permalink
build: update to ruby v3.1.2, rails v6.1.6.1 (#70)
Browse files Browse the repository at this point in the history
  • Loading branch information
jufemaiz authored Jul 26, 2022
1 parent c400fc4 commit b06b314
Show file tree
Hide file tree
Showing 45 changed files with 776 additions and 400 deletions.
144 changes: 141 additions & 3 deletions .rubocop.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,149 @@
---
AllCops:
NewCops: enable

Gemspec/DeprecatedAttributeAssignment: # new in 1.30
Enabled: true
Gemspec/RequireMFA: # new in 1.23
Enabled: true
Layout/LineContinuationLeadingSpace: # new in 1.31
Enabled: true
Layout/LineContinuationSpacing: # new in 1.31
Enabled: true
Layout/LineEndStringConcatenationIndentation: # new in 1.18
Enabled: true
Layout/SpaceBeforeBrackets: # new in 1.7
Enabled: true
Lint/AmbiguousAssignment: # new in 1.7
Enabled: true
Lint/AmbiguousOperatorPrecedence: # new in 1.21
Enabled: true
Lint/AmbiguousRange: # new in 1.19
Enabled: true
Lint/ConstantOverwrittenInRescue: # new in 1.31
Enabled: true
Lint/DeprecatedConstants: # new in 1.8
Enabled: true
Lint/DuplicateBranch: # new in 1.3
Enabled: true
Lint/DuplicateRegexpCharacterClassElement: # new in 1.1
Enabled: true
Lint/EmptyBlock: # new in 1.1
Enabled: true
Lint/EmptyClass: # new in 1.3
Enabled: true
Lint/EmptyInPattern: # new in 1.16
Enabled: true
Lint/IncompatibleIoSelectWithFiberScheduler: # new in 1.21
Enabled: true
Lint/LambdaWithoutLiteralBlock: # new in 1.8
Enabled: true
Lint/NoReturnInBeginEndBlocks: # new in 1.2
Enabled: true
Lint/NonAtomicFileOperation: # new in 1.31
Enabled: true
Lint/NumberedParameterAssignment: # new in 1.9
Enabled: true
Lint/OrAssignmentToConstant: # new in 1.9
Enabled: true
Lint/RedundantDirGlobSort: # new in 1.8
Enabled: true
Lint/RefinementImportMethods: # new in 1.27
Enabled: true
Lint/RequireRangeParentheses: # new in 1.32
Enabled: true
Lint/RequireRelativeSelfPath: # new in 1.22
Enabled: true
Lint/SymbolConversion: # new in 1.9
Enabled: true
Lint/Syntax:
Enabled: true
Lint/ToEnumArguments: # new in 1.1
Enabled: true
Lint/TripleQuotes: # new in 1.9
Enabled: true
Lint/UnexpectedBlockArity: # new in 1.5
Enabled: true
Lint/UnmodifiedReduceAccumulator: # new in 1.1
Enabled: true
Lint/UselessRuby2Keywords: # new in 1.23
Enabled: true
Naming/BlockForwarding: # new in 1.24
Enabled: true
Security/CompoundHash: # new in 1.28
Enabled: true
Security/IoMethods: # new in 1.22
Enabled: true
Style/ArgumentsForwarding: # new in 1.1
Enabled: true
Style/CollectionCompact: # new in 1.2
Enabled: true
Style/DocumentDynamicEvalDefinition: # new in 1.1
Enabled: true
Style/EmptyHeredoc: # new in 1.32
Enabled: true
Style/EndlessMethod: # new in 1.8
Enabled: true
Style/EnvHome: # new in 1.29
Enabled: true
Style/FetchEnvVar: # new in 1.28
Enabled: true
Style/FileRead: # new in 1.24
Enabled: true
Style/FileWrite: # new in 1.24
Enabled: true
Style/HashConversion: # new in 1.10
Enabled: true
Style/HashExcept: # new in 1.7
Enabled: true
Style/IfWithBooleanLiteralBranches: # new in 1.9
Enabled: true
Style/InPatternThen: # new in 1.16
Enabled: true
Style/MapCompactWithConditionalBlock: # new in 1.30
Enabled: true
Style/MapToHash: # new in 1.24
Enabled: true
Style/MultilineInPatternThen: # new in 1.16
Enabled: true
Style/NegatedIfElseCondition: # new in 1.2
Enabled: true
Style/NestedFileDirname: # new in 1.26
Enabled: true
Style/NilLambda: # new in 1.3
Enabled: true
Style/NumberedParameters: # new in 1.22
Enabled: true
Style/NumberedParametersLimit: # new in 1.22
Enabled: true
Style/ObjectThen: # new in 1.28
Enabled: true
Style/OpenStructUse: # new in 1.23
Enabled: true
Style/QuotedSymbols: # new in 1.16
Enabled: true
Style/RedundantArgument: # new in 1.4
Enabled: true
Style/RedundantInitialize: # new in 1.27
Enabled: true
Style/RedundantSelfAssignmentBranch: # new in 1.19
Enabled: true
Style/SelectByRegexp: # new in 1.22
Enabled: true
Style/StringChars: # new in 1.12
Enabled: true
Style/SwapValues: # new in 1.1
Enabled: true

Layout/EmptyLinesAroundBlockBody:
Exclude:
- 'db/schema.rb'

Layout/LineLength:
Max: 160

Metrics/AbcSize:
Max: 35
Exclude:
- 'db/migrate/**/*.rb'

Expand All @@ -16,10 +156,8 @@ Metrics/BlockLength:
- 'db/seeds.rb'
- 'spec/**/*.rb'

Metrics/LineLength:
Max: 100

Metrics/MethodLength:
Max: 15
Exclude:
- 'db/migrate/**/*.rb'

Expand Down
2 changes: 1 addition & 1 deletion .ruby-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2.7.6
3.1.2
3 changes: 2 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
FROM ruby:2.7.6-alpine3.15
FROM ruby:3.1.2-alpine3.15

RUN apk add --update alpine-sdk && \
apk add bash build-base git libxml2-dev libxslt-dev nodejs postgresql-dev readline-dev tzdata zlib-dev && \
gem install bundler && \
mkdir /app

WORKDIR /app
Expand Down
145 changes: 76 additions & 69 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -1,75 +1,82 @@
# frozen_string_literal: true

ruby '2.7.6'
ruby '3.1.2'

source 'https://rubygems.org'

git_source(:github) { |repo| "https://github.com/#{repo}.git" }

source 'https://rubygems.org' do
gem 'bundle', '~> 2.3', '>= 2.3.18'
# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'rails', '~> 5.2', '>= 5.2.8.1'
# Use Postgres as the database for Active Record
gem 'pg'
# Use Puma as the app server
gem 'puma', '~> 4.3', '>= 4.3.9'
# Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder
gem 'jbuilder', '~> 2.10', '>= 2.10.0'
# Use Redis adapter to run Action Cable in production
# gem 'redis', '~> 4.0'
# Use ActiveModel has_secure_password
gem 'bcrypt', '~> 3.1.7'

# v1 api is [JSONAPI](https://jsonapi.org/)
gem 'jsonapi-resources', '~> 0.10', '>= 0.10.7'

# v2 api is [GraphQL](https://graphql.org/)
gem 'graphql', '~> 1.7', '>= 1.7.14'

# Use ActiveStorage variant
# gem 'mini_magick', '~> 4.8'

# Use Capistrano for deployment
# gem 'capistrano-rails', group: :development

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

# Use Rack CORS for handling Cross-Origin Resource Sharing (CORS), making
# cross-origin AJAX possible
# gem 'rack-cors'

# Geokit for distance information
gem 'geokit-rails'

group :development, :test do
# Call 'byebug' anywhere in the code to stop execution and get a debugger
# console
gem 'byebug', platforms: %i[mri mingw x64_mingw]
gem 'database_cleaner', '~> 1.7', '>= 1.7.0'
gem 'factory_bot_rails', '~> 4.11', '>= 4.11.1'
gem 'faker', '~> 1.9', '>= 1.9.1'
gem 'rspec-graphql_matchers'
gem 'rspec-rails', '~> 3.9', '>= 3.9.1'
gem 'shoulda-matchers', '~> 3.1', '>= 3.1.3'
end

group :development do
gem 'listen', '>= 3.0.5', '< 3.2'
gem 'rerun'
gem 'rubocop'
# Spring speeds up development by keeping your application running in the
# background. Read more: https://github.com/rails/spring
gem 'spring'
gem 'spring-watcher-listen', '~> 2.0.1'
gem 'yard'
end

group :test do
gem 'coveralls', require: false
# gem 'simplecov', require: false
gem 'timecop', '~> 0.9'
end

# Windows does not include zoneinfo files, so bundle the tzinfo-data gem
gem 'tzinfo-data', platforms: %i[mingw mswin x64_mingw jruby]
gem 'bundler', '~> 2.3', '>= 2.3.18'
gem 'rexml', '~> 3.2', '>= 3.2.5'

# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'rails', '~> 6.0' # , '>= 5.2.8.1'
# Use Postgres as the database for Active Record
gem 'pg'
# Use Puma as the app server
gem 'puma', '~> 5.6', '>= 5.6.4'
# Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder
gem 'jbuilder', '~> 2.11', '>= 2.11.5'
# Use Redis adapter to run Action Cable in production
# gem 'redis', '~> 4.0'
# Use ActiveModel has_secure_password
gem 'bcrypt', '~> 3.1', '>= 3.1.18'

# v1 api is [JSONAPI](https://jsonapi.org/)
gem 'jsonapi-resources', '~> 0.10', '>= 0.10.7'

# v2 api is [GraphQL](https://graphql.org/)
gem 'graphql', '~> 1.13', '>= 1.13.15'

# Use ActiveStorage variant
# gem 'mini_magick', '~> 4.8'

# Use Capistrano for deployment
# gem 'capistrano-rails', group: :development

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

# Use Rack CORS for handling Cross-Origin Resource Sharing (CORS), making
# cross-origin AJAX possible
# gem 'rack-cors'

# Geokit for distance information
gem 'geokit-rails', '~> 2.3'

# Net - ref: https://stackoverflow.com/questions/70500220/rails-7-ruby-3-1-loaderror-cannot-load-such-file-net-smtp.
gem 'net-imap', require: false
gem 'net-pop', require: false
gem 'net-smtp', require: false

group :development, :test do
# Call 'byebug' anywhere in the code to stop execution and get a debugger
# console
gem 'byebug', platforms: %i[mri mingw x64_mingw]
gem 'database_cleaner', '~> 1.7', '>= 1.7.0'
gem 'factory_bot_rails', '~> 4.11', '>= 4.11.1'
gem 'faker', '~> 2.21', '>= 2.21.0'
gem 'rspec-graphql_matchers', '~> 1.3'
gem 'rspec-rails', '~> 3.9', '>= 3.9.1'
gem 'shoulda-matchers', '~> 3.1', '>= 3.1.3'
end

group :development do
gem 'listen', '>= 3.0.5', '< 3.2'
gem 'rerun', '>= 0.13.1'
gem 'rubocop', '~> 1.32'
# Spring speeds up development by keeping your application running in the
# background. Read more: https://github.com/rails/spring
gem 'spring'
gem 'spring-watcher-listen', '~> 2.0.1'
gem 'yard'
end

group :test do
gem 'coveralls', require: false
# gem 'simplecov', require: false
gem 'timecop', '~> 0.9'
end

# Windows does not include zoneinfo files, so bundle the tzinfo-data gem
gem 'tzinfo-data', platforms: %i[mingw mswin x64_mingw jruby]
Loading

0 comments on commit b06b314

Please sign in to comment.