Skip to content

Commit 3873176

Browse files
author
Vladimir Bazhanov
authored
Rails 6.0.3.1 with Webpacker upgrade (#579)
- 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
1 parent df19434 commit 3873176

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

55 files changed

+8353
-401
lines changed

.browserslistrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
defaults

.codeclimate.yml

Lines changed: 0 additions & 36 deletions
This file was deleted.

.gitignore

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,10 @@ tmp/*
1313
vendor/bundle
1414
vendor/cache
1515
vendor/ruby
16+
/public/assets
17+
/public/packs
18+
/public/packs-test
19+
/node_modules
20+
/yarn-error.log
21+
yarn-debug.log*
22+
.yarn-integrity

.nvmrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
v12.18.0

.rubocop.yml

Lines changed: 47 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,63 @@
1-
require: rubocop-rspec
1+
require:
2+
- rubocop-rails
3+
- rubocop-rspec
24

35
Rails:
46
Enabled: true
57

68
AllCops:
7-
TargetRubyVersion: 2.4
9+
TargetRubyVersion: 2.7
810
DisplayCopNames: true
911
Exclude:
1012
- bin/**/*
1113
- db/**/*
14+
- node_modules/**/*
1215
- vendor/**/*
1316
- tmp/**/*
1417

18+
Capybara/FeatureMethods:
19+
EnabledMethods:
20+
- background
21+
- feature
22+
- scenario
23+
24+
# Rails
25+
26+
Rails/FilePath:
27+
EnforcedStyle: arguments
28+
29+
Rails/UnknownEnv:
30+
Environments:
31+
- development
32+
- test
33+
- staging
34+
- production
35+
1536
Rails/HasAndBelongsToMany:
1637
Enabled: false
1738

1839
Rails/OutputSafety:
1940
Enabled: false
2041

42+
# RSpec
43+
2144
RSpec/MultipleExpectations:
2245
Enabled: false
2346

2447
RSpec/ExampleLength:
2548
Enabled: false
2649

50+
RSpec/HookArgument:
51+
EnforcedStyle: each
52+
2753
RSpec/RepeatedDescription:
2854
Enabled: false
2955

3056
RSpec/MessageSpies:
3157
EnforcedStyle: receive
3258

59+
# Style
60+
3361
Style/AndOr:
3462
Enabled: false
3563

@@ -61,23 +89,31 @@ Style/FrozenStringLiteralComment:
6189
Style/StringMethods:
6290
Enabled: true
6391

64-
Metrics/LineLength:
65-
Max: 120
66-
67-
Metrics/MethodLength:
68-
Max: 16
69-
70-
Metrics/BlockLength:
92+
Style/NestedTernaryOperator:
7193
Enabled: false
7294

73-
Layout/AlignParameters:
95+
# Layout
96+
97+
Layout/ParameterAlignment:
7498
EnforcedStyle: with_fixed_indentation
7599
SupportedStyles:
76100
- with_first_parameter
77101
- with_fixed_indentation
78102

79-
Lint/EndAlignment:
103+
Layout/EndAlignment:
80104
EnforcedStyleAlignWith: variable
81105
SupportedStylesAlignWith:
82106
- keyword
83107
- variable
108+
109+
Layout/LineLength:
110+
Max: 120
111+
112+
# Metrics
113+
114+
Metrics/MethodLength:
115+
Max: 16
116+
117+
Metrics/BlockLength:
118+
Enabled: false
119+

.ruby-version

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
2.5.7
1+
2.7.1

.semaphore/semaphore.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,10 +53,12 @@ blocks:
5353
task:
5454
prologue:
5555
commands:
56+
- nvm use
5657
- sem-version ruby 2.5.7
5758
- bundle install ${BUNDLE_ARGS} --local
5859
- sem-service start postgres
5960
- bin/rails db:setup
61+
- bin/rails assets:precompile
6062

6163
jobs:
6264
- name: Unit

.slim-lint.yml

Lines changed: 3 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -23,23 +23,11 @@ linters:
2323
# These cops are incredibly noisy since the Ruby we extract from Slim
2424
# templates isn't well-formatted, so we ignore them.
2525
ignored_cops:
26-
- Lint/BlockAlignment
26+
- Layout/TrailingEmptyLines
2727
- Lint/EndAlignment
28+
- Layout/ArgumentAlignment
2829
- Lint/Void
29-
- Metrics/LineLength
30-
- Style/AlignHash
31-
- Style/AlignParameters
32-
- Style/BlockNesting
33-
- Style/FileName
34-
- Style/FirstParameterIndentation
35-
- Style/IfUnlessModifier
36-
- Style/IndentationConsistency
37-
- Style/IndentationWidth
38-
- Style/Next
39-
- Style/TrailingBlankLines
40-
- Style/TrailingWhitespace
41-
- Style/WhileUntilModifier
42-
- Style/NestedTernaryOperator
30+
- Layout/IndentationWidth
4331

4432
TagCase:
4533
enabled: true

Brewfile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
cask "phantomjs"
22

33
brew "graphviz"
4-
brew "node"
4+
brew "node@12"
55
brew "postgresql"
6+
brew "yarn"

Gemfile

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,21 @@
11
source "https://rubygems.org"
22

3-
ruby "2.5.7"
3+
ruby "2.7.1"
44

55
gem "pg"
6-
gem "rails", "5.2.4.3"
6+
7+
gem "rails", "6.0.3.1"
78

89
# assets
910
gem "autoprefixer-rails"
1011
gem "aws-sdk-s3"
11-
gem "coffee-rails"
1212
gem "foundation-icons-sass-rails"
1313
gem "foundation-rails"
1414
gem "image_processing"
1515
gem "premailer-rails"
1616
gem "sass-rails", "~> 5.0.0", ">= 5.0.6"
1717
gem "uglifier", ">= 2.7.2"
18-
19-
source "https://rails-assets.org" do
20-
gem "rails-assets-jquery-ujs"
21-
gem "rails-assets-jquery2"
22-
end
18+
gem "webpacker"
2319

2420
# views
2521
gem "active_link_to"
@@ -56,7 +52,6 @@ end
5652

5753
group :test do
5854
gem "capybara"
59-
gem "codeclimate-test-reporter", require: false
6055
gem "database_cleaner"
6156
gem "email_spec"
6257
gem "formulaic"
@@ -75,14 +70,14 @@ group :development, :test do
7570
gem "bullet"
7671
gem "bundler-audit", require: false
7772
gem "byebug"
78-
gem "coffeelint"
7973
gem "dotenv-rails"
8074
gem "factory_bot_rails"
8175
gem "faker"
8276
gem "jasmine", "> 2.0"
8377
gem "jasmine-jquery-rails"
8478
gem "rspec-rails", "~> 3.5"
8579
gem "rubocop", require: false
80+
gem "rubocop-rails", require: false
8681
gem "rubocop-rspec", require: false
8782
gem "scss_lint", require: false
8883
gem "slim_lint", require: false

0 commit comments

Comments
 (0)