Skip to content

Commit

Permalink
Rails 6.0.3.1 with Webpacker upgrade (#579)
Browse files Browse the repository at this point in the history
-  Rails version upgraded to 6.0.3.1
-  Added Webpacker as default JavaScript compiler
-  Updated linters (Rubocop, slim-lint and others"
-  Ruby version used 2.7.1
-  jQuery updated to 3rd version and connected using Webpacker
-  jQuery UJS removed and replaced with @rails/ujs loaded with Webpacker
-  Removed support for CoffeeScript
-  bundler-audit uncommented and all security issues fixed
  • Loading branch information
Vladimir Bazhanov authored Jun 15, 2020
1 parent df19434 commit 3873176
Show file tree
Hide file tree
Showing 55 changed files with 8,353 additions and 401 deletions.
1 change: 1 addition & 0 deletions .browserslistrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
defaults
36 changes: 0 additions & 36 deletions .codeclimate.yml

This file was deleted.

7 changes: 7 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,10 @@ tmp/*
vendor/bundle
vendor/cache
vendor/ruby
/public/assets
/public/packs
/public/packs-test
/node_modules
/yarn-error.log
yarn-debug.log*
.yarn-integrity
1 change: 1 addition & 0 deletions .nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
v12.18.0
58 changes: 47 additions & 11 deletions .rubocop.yml
Original file line number Diff line number Diff line change
@@ -1,35 +1,63 @@
require: rubocop-rspec
require:
- rubocop-rails
- rubocop-rspec

Rails:
Enabled: true

AllCops:
TargetRubyVersion: 2.4
TargetRubyVersion: 2.7
DisplayCopNames: true
Exclude:
- bin/**/*
- db/**/*
- node_modules/**/*
- vendor/**/*
- tmp/**/*

Capybara/FeatureMethods:
EnabledMethods:
- background
- feature
- scenario

# Rails

Rails/FilePath:
EnforcedStyle: arguments

Rails/UnknownEnv:
Environments:
- development
- test
- staging
- production

Rails/HasAndBelongsToMany:
Enabled: false

Rails/OutputSafety:
Enabled: false

# RSpec

RSpec/MultipleExpectations:
Enabled: false

RSpec/ExampleLength:
Enabled: false

RSpec/HookArgument:
EnforcedStyle: each

RSpec/RepeatedDescription:
Enabled: false

RSpec/MessageSpies:
EnforcedStyle: receive

# Style

Style/AndOr:
Enabled: false

Expand Down Expand Up @@ -61,23 +89,31 @@ Style/FrozenStringLiteralComment:
Style/StringMethods:
Enabled: true

Metrics/LineLength:
Max: 120

Metrics/MethodLength:
Max: 16

Metrics/BlockLength:
Style/NestedTernaryOperator:
Enabled: false

Layout/AlignParameters:
# Layout

Layout/ParameterAlignment:
EnforcedStyle: with_fixed_indentation
SupportedStyles:
- with_first_parameter
- with_fixed_indentation

Lint/EndAlignment:
Layout/EndAlignment:
EnforcedStyleAlignWith: variable
SupportedStylesAlignWith:
- keyword
- variable

Layout/LineLength:
Max: 120

# Metrics

Metrics/MethodLength:
Max: 16

Metrics/BlockLength:
Enabled: false

2 changes: 1 addition & 1 deletion .ruby-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2.5.7
2.7.1
2 changes: 2 additions & 0 deletions .semaphore/semaphore.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,12 @@ blocks:
task:
prologue:
commands:
- nvm use
- sem-version ruby 2.5.7
- bundle install ${BUNDLE_ARGS} --local
- sem-service start postgres
- bin/rails db:setup
- bin/rails assets:precompile

jobs:
- name: Unit
Expand Down
18 changes: 3 additions & 15 deletions .slim-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,23 +23,11 @@ linters:
# These cops are incredibly noisy since the Ruby we extract from Slim
# templates isn't well-formatted, so we ignore them.
ignored_cops:
- Lint/BlockAlignment
- Layout/TrailingEmptyLines
- Lint/EndAlignment
- Layout/ArgumentAlignment
- Lint/Void
- Metrics/LineLength
- Style/AlignHash
- Style/AlignParameters
- Style/BlockNesting
- Style/FileName
- Style/FirstParameterIndentation
- Style/IfUnlessModifier
- Style/IndentationConsistency
- Style/IndentationWidth
- Style/Next
- Style/TrailingBlankLines
- Style/TrailingWhitespace
- Style/WhileUntilModifier
- Style/NestedTernaryOperator
- Layout/IndentationWidth

TagCase:
enabled: true
Expand Down
3 changes: 2 additions & 1 deletion Brewfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
cask "phantomjs"

brew "graphviz"
brew "node"
brew "node@12"
brew "postgresql"
brew "yarn"
15 changes: 5 additions & 10 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -1,25 +1,21 @@
source "https://rubygems.org"

ruby "2.5.7"
ruby "2.7.1"

gem "pg"
gem "rails", "5.2.4.3"

gem "rails", "6.0.3.1"

# assets
gem "autoprefixer-rails"
gem "aws-sdk-s3"
gem "coffee-rails"
gem "foundation-icons-sass-rails"
gem "foundation-rails"
gem "image_processing"
gem "premailer-rails"
gem "sass-rails", "~> 5.0.0", ">= 5.0.6"
gem "uglifier", ">= 2.7.2"

source "https://rails-assets.org" do
gem "rails-assets-jquery-ujs"
gem "rails-assets-jquery2"
end
gem "webpacker"

# views
gem "active_link_to"
Expand Down Expand Up @@ -56,7 +52,6 @@ end

group :test do
gem "capybara"
gem "codeclimate-test-reporter", require: false
gem "database_cleaner"
gem "email_spec"
gem "formulaic"
Expand All @@ -75,14 +70,14 @@ group :development, :test do
gem "bullet"
gem "bundler-audit", require: false
gem "byebug"
gem "coffeelint"
gem "dotenv-rails"
gem "factory_bot_rails"
gem "faker"
gem "jasmine", "> 2.0"
gem "jasmine-jquery-rails"
gem "rspec-rails", "~> 3.5"
gem "rubocop", require: false
gem "rubocop-rails", require: false
gem "rubocop-rspec", require: false
gem "scss_lint", require: false
gem "slim_lint", require: false
Expand Down
Loading

0 comments on commit 3873176

Please sign in to comment.