From 44135dc14821215810c81c4a9a049fdeec584398 Mon Sep 17 00:00:00 2001 From: Hugh Do Date: Wed, 12 Aug 2020 10:58:13 +0700 Subject: [PATCH 01/49] commit 14 --- .github/workflows/deployment.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/deployment.yml b/.github/workflows/deployment.yml index 0dcff6a..2052ac1 100644 --- a/.github/workflows/deployment.yml +++ b/.github/workflows/deployment.yml @@ -18,7 +18,7 @@ jobs: pip3 install framgia-ci pip3 uninstall --yes cleo clikit yes | pip3 install cleo==0.6.8 - - name: Run CI + - name: Run CIII run: | cd api ls -la && pwd From 9b0d4cea6b4794aaf29cff17a70a2db26c4ae6f7 Mon Sep 17 00:00:00 2001 From: Hugh Do Date: Wed, 12 Aug 2020 14:14:00 +0700 Subject: [PATCH 02/49] commit 15 --- .DS_Store | Bin 6148 -> 6148 bytes .github/workflows/deployment.yml | 25 +++++++++++-------------- api/.DS_Store | Bin 8196 -> 8196 bytes api/Gemfile | 4 +++- 4 files changed, 14 insertions(+), 15 deletions(-) diff --git a/.DS_Store b/.DS_Store index 182f6f04911c8e1f939685b032e5fbc6f394645d..6cdf3a52c083c71421678a0fd0ff95769308a27a 100644 GIT binary patch delta 529 zcmZoMXfc=|#>B!ku~2NHo+2ar#(>?7i$5?kF|u#wVX|jrGdI;yFtVH+$m~;}nOs(o zl#`#tz`(dUsURn_xWvHVzJLHD6Eh1d8#@Ol7dHKkyB1-YIJ&0W=e2DVsd6)dPGTTMM-dGRcgF|5Sr4U)RZ`= zP(4t4NM!*~kqDY1_oCF)Jg|ZOX=%l&B@yug{Kd&d`8hcO`Nf$fnfZB;o1?LRPpfwF@)jG+Nx2rwu^7z_*?0*oPf`FW|FoXQRX zP(cm`Z3agMUxqM-Y=$a^i41cY)-&vOVmQHYm*G9bPeyh|Nk%0`ZAKGDTSj|E4@OT$ zZ^i(|K*k`5b|yxsF)}baAT(q2nLsKwM~JLp F1^|Ttj?n-B delta 79 zcmZoMXfc=|#>B)qu~2NHo+2aL#(>?7jBJ~ESnL_uj7@bEjEyG;vieL;V_&#gf#W3e hW_AvK4xsYQf*jwOC-aLqaxee^BLf4=<_M8B%m42Hwr=94s7+5}Qo~R 1.4' # Use Puma as the app server gem 'puma', '~> 4.1' gem "rails_best_practices" -gem "rubocop", "~> 0.74.0", require: false +gem "reek" +gem 'rubocop', require: falsex +gem "rspec-rails" gem "rubocop-checkstyle_formatter", require: false gem "rubocop-rails", "~> 2.3.2", require: false # Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder From ad4d981476162ebd4e450bc27dcdbe811c14f995 Mon Sep 17 00:00:00 2001 From: Hugh Do Date: Wed, 12 Aug 2020 14:15:37 +0700 Subject: [PATCH 03/49] commit 16 --- .github/workflows/deployment.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/deployment.yml b/.github/workflows/deployment.yml index e802abb..f3abada 100644 --- a/.github/workflows/deployment.yml +++ b/.github/workflows/deployment.yml @@ -7,6 +7,8 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 + - name: Install bundle + run: gem install bundler - run: | cd api sudo bundle install From a4558d5f9f3adc12b78f9c9104928a3a55d727ef Mon Sep 17 00:00:00 2001 From: Hugh Do Date: Wed, 12 Aug 2020 14:16:22 +0700 Subject: [PATCH 04/49] commit 17 --- .github/workflows/deployment.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/deployment.yml b/.github/workflows/deployment.yml index f3abada..b1e5d9c 100644 --- a/.github/workflows/deployment.yml +++ b/.github/workflows/deployment.yml @@ -8,7 +8,7 @@ jobs: steps: - uses: actions/checkout@v2 - name: Install bundle - run: gem install bundler + run: sudo gem install bundler - run: | cd api sudo bundle install From 11be78b98e250ea2972bf67b975801e60b10a934 Mon Sep 17 00:00:00 2001 From: Hugh Do Date: Wed, 12 Aug 2020 14:17:58 +0700 Subject: [PATCH 05/49] commit 18 --- .github/workflows/deployment.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/deployment.yml b/.github/workflows/deployment.yml index b1e5d9c..12f440f 100644 --- a/.github/workflows/deployment.yml +++ b/.github/workflows/deployment.yml @@ -8,7 +8,7 @@ jobs: steps: - uses: actions/checkout@v2 - name: Install bundle - run: sudo gem install bundler + run: sudo gem install bundler:1.17.2 - run: | cd api sudo bundle install From 96cbba1c60cf8506943032773ad54544e038da10 Mon Sep 17 00:00:00 2001 From: Hugh Do Date: Wed, 12 Aug 2020 14:18:53 +0700 Subject: [PATCH 06/49] commit 19 --- api/Gemfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/api/Gemfile b/api/Gemfile index 0e6dfb2..9457482 100644 --- a/api/Gemfile +++ b/api/Gemfile @@ -11,7 +11,7 @@ gem 'sqlite3', '~> 1.4' gem 'puma', '~> 4.1' gem "rails_best_practices" gem "reek" -gem 'rubocop', require: falsex +gem 'rubocop', require: false gem "rspec-rails" gem "rubocop-checkstyle_formatter", require: false gem "rubocop-rails", "~> 2.3.2", require: false From af3ff4909cda7a81ada27ecec59bb2bf68cb3862 Mon Sep 17 00:00:00 2001 From: Hugh Do Date: Wed, 12 Aug 2020 14:20:22 +0700 Subject: [PATCH 07/49] commit 20 --- .github/workflows/deployment.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/deployment.yml b/.github/workflows/deployment.yml index 12f440f..7b0f216 100644 --- a/.github/workflows/deployment.yml +++ b/.github/workflows/deployment.yml @@ -11,7 +11,7 @@ jobs: run: sudo gem install bundler:1.17.2 - run: | cd api - sudo bundle install + bundle install - run: | pwd - name: Rubocop From 1a9d374ba98df4ca3d938380bf03224eb54b735a Mon Sep 17 00:00:00 2001 From: Hugh Do Date: Wed, 12 Aug 2020 14:21:36 +0700 Subject: [PATCH 08/49] commit 21 --- api/Gemfile | 2 -- 1 file changed, 2 deletions(-) diff --git a/api/Gemfile b/api/Gemfile index 9457482..32b4f86 100644 --- a/api/Gemfile +++ b/api/Gemfile @@ -1,8 +1,6 @@ source 'https://rubygems.org' git_source(:github) { |repo| "https://github.com/#{repo}.git" } -ruby '2.6.3' - # Bundle edge Rails instead: gem 'rails', github: 'rails/rails' gem 'rails', '~> 6.0.3', '>= 6.0.3.2' # Use sqlite3 as the database for Active Record From cb57b7b549d1f8ad7d4c8f726406b69ed920742e Mon Sep 17 00:00:00 2001 From: Hugh Do Date: Wed, 12 Aug 2020 14:25:24 +0700 Subject: [PATCH 09/49] commit 22 --- api/Gemfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/api/Gemfile b/api/Gemfile index 32b4f86..b2e805c 100644 --- a/api/Gemfile +++ b/api/Gemfile @@ -9,7 +9,7 @@ gem 'sqlite3', '~> 1.4' gem 'puma', '~> 4.1' gem "rails_best_practices" gem "reek" -gem 'rubocop', require: false +gem 'rubocop', '~>0.54.0', require: false gem "rspec-rails" gem "rubocop-checkstyle_formatter", require: false gem "rubocop-rails", "~> 2.3.2", require: false From 3c31dd03511739d0921ff7f7ec996169a1e93dd7 Mon Sep 17 00:00:00 2001 From: Hugh Do Date: Wed, 12 Aug 2020 14:28:12 +0700 Subject: [PATCH 10/49] commit 23 --- api/Gemfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/api/Gemfile b/api/Gemfile index b2e805c..75cba7b 100644 --- a/api/Gemfile +++ b/api/Gemfile @@ -9,7 +9,7 @@ gem 'sqlite3', '~> 1.4' gem 'puma', '~> 4.1' gem "rails_best_practices" gem "reek" -gem 'rubocop', '~>0.54.0', require: false +gem 'rubocop', '~> 0.54.0', require: false gem "rspec-rails" gem "rubocop-checkstyle_formatter", require: false gem "rubocop-rails", "~> 2.3.2", require: false From 3c4ae0dee259bc3a4ae226804c1c70da9ce602b8 Mon Sep 17 00:00:00 2001 From: Hugh Do Date: Wed, 12 Aug 2020 14:30:32 +0700 Subject: [PATCH 11/49] commit 24 --- api/Gemfile | 1 - 1 file changed, 1 deletion(-) diff --git a/api/Gemfile b/api/Gemfile index 75cba7b..5d75f01 100644 --- a/api/Gemfile +++ b/api/Gemfile @@ -12,7 +12,6 @@ gem "reek" gem 'rubocop', '~> 0.54.0', require: false gem "rspec-rails" gem "rubocop-checkstyle_formatter", require: false -gem "rubocop-rails", "~> 2.3.2", require: false # Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder # gem 'jbuilder', '~> 2.7' # Use Redis adapter to run Action Cable in production From 2d8115c03379e9f310f8b0a95da9d110030e5697 Mon Sep 17 00:00:00 2001 From: Hugh Do Date: Wed, 12 Aug 2020 14:35:42 +0700 Subject: [PATCH 12/49] commit 25 --- .DS_Store | Bin 6148 -> 6148 bytes api/.DS_Store | Bin 8196 -> 8196 bytes api/.rubocop.yml | 93 ++++++++++------------ api/.rubocop_enabled.yml | 166 +++++++++++++++++++-------------------- api/Gemfile | 2 +- 5 files changed, 122 insertions(+), 139 deletions(-) diff --git a/.DS_Store b/.DS_Store index 6cdf3a52c083c71421678a0fd0ff95769308a27a..a1117b23332ed9331a855e159cf83d031b73d6a4 100644 GIT binary patch delta 317 zcmZoMXffC@m&Nd8QbA5;afyM!bw(y;7FITP4h}93E?%zK;Eeq8;F83W(qgB?qG%8= zAh9GPDRJ^+7SA*e4o(ivcmav(YEwf)9R(9h(^?&cYIAb~Aluliww9AaT-DIlGa1Q;l+>ieqVUX=l8lhlJlCAmveZ2PBA>*P)XC>qJnN%D8UhkaGJuLWlpWF(7(jrN zgEL-0qPp79+*C)w$kL=%N1@u>+(1Xc#MrF1mXm`+Qr#^muC%Fd*6bxqmn}bZ7_5td zkr6^O2tsKXbp*&@W=LcxV93l&E-OgN$xmWnVBDNkFu9&pfm2jeOk7k#Qc`;I3f4Q) z@dEtCKsR|N=jR0!rIux;mPcd)*}<7rsgviksR?rkFoxvi=cRITDmw%~ESUU|P0?JE wQHfET(S*^K(Vo$R(UZ}eF@Q0UF$ki93Fa~xn3EthWAtQe_SKu&IsWnk0HvN%7XSbN diff --git a/api/.DS_Store b/api/.DS_Store index 785201bebaa3cdf599eb4c2aa0a1b8c42eb27b6c..c188676d10bc9313a538cb4f4acace6d6af543c2 100644 GIT binary patch delta 90 zcmZp1XmOa}FDlN!z`)4BAi%(o%aG2H$&kpP%aFXWa2or>2Hwr=94s8{AQk)!dXuLJ oY4I_B2CA<34+abjlX(QTPW~z2wYghRi+OV~&lKj(>=J+30polc761SM delta 140 zcmZp1XmOa}FDk*nz`)4BAi%(o$&k*F$B@rZ#E`nNa2or>2Hwr=94s7+5|h0IwrcV) z=mBL)8Ipi1l7YAY$ggC`WytZ&$xlwo$xi~B12ly3^W+Z#k>Vm4s^b|_8S*Ae2r4qR XZnhG%WZt|_#*KMm1J7o5iNEXss3;+B diff --git a/api/.rubocop.yml b/api/.rubocop.yml index 666daa6..34f725f 100644 --- a/api/.rubocop.yml +++ b/api/.rubocop.yml @@ -13,24 +13,24 @@ inherit_from: AllCops: # Include gemspec and Rakefile Include: - - 'app/**/*' - - 'lib/**/*' - - '**/*.gemspec' - - 'Gemfile' + - "app/**/*" + - "lib/**/*" + - "**/*.gemspec" + - "Gemfile" Exclude: - - 'vendor/**/*' - - 'config/unicorn.rb' - - 'bin/*' - - 'db/**/*' - - 'spec/**/*' - - 'script/rails' - - 'config/**/*' - - 'app/views/**/*' - - 'app/assets/**/*' - - 'app/javascript/**/*' - - '.idea/**/*' - - '**/.DS_Store' - - '**/.keep' + - "vendor/**/*" + - "config/unicorn.rb" + - "bin/*" + - "db/**/*" + - "spec/**/*" + - "script/rails" + - "config/**/*" + - "app/views/**/*" + - "app/assets/**/*" + - "app/javascript/**/*" + - ".idea/**/*" + - "**/.DS_Store" + - "**/.keep" # Indent private/protected/public as deep as method definitions Layout/AccessModifierIndentation: @@ -40,7 +40,7 @@ Layout/AccessModifierIndentation: - indent # Align the elements of a hash literal if they span more than one line. -Layout/AlignHash: +Layout/HashAlignment: # Alignment of entries using hash rocket as separator. Valid values are: # # key - left alignment of keys @@ -103,7 +103,7 @@ Layout/AlignHash: - ignore_implicit - ignore_explicit -Layout/AlignParameters: +Layout/ParameterAlignment: # Alignment of parameters in multi-line method calls. # # The `with_first_parameter` style aligns the following lines along the same column @@ -130,12 +130,6 @@ Metrics/AbcSize: # a Float. Max: 20 -Style/BracesAroundHashParameters: - EnforcedStyle: no_braces - SupportedStyles: - - braces - - no_braces - # Indentation of `when`. Layout/CaseIndentation: EnforcedStyle: case @@ -172,7 +166,7 @@ Style/ClassCheck: - kind_of? Metrics/ClassLength: - CountComments: false # count full line comments? + CountComments: false # count full line comments? Max: 100 # Align with the style guide. @@ -184,11 +178,11 @@ Style/CollectionMethods: # PreferredMethods: # find: detect PreferredMethods: - collect: 'map' - collect!: 'map!' - inject: 'reduce' - detect: 'find' - find_all: 'select' + collect: "map" + collect!: "map!" + inject: "reduce" + detect: "find" + find_all: "select" # Checks formatting of special comments Style/CommentAnnotation: @@ -233,9 +227,9 @@ Layout/EmptyLinesAroundModuleBody: Naming/FileName: Exclude: - - '**/Rakefile' - - '**/Gemfile' - - '**/Capfile' + - "**/Rakefile" + - "**/Gemfile" + - "**/Capfile" # Checks use of for or each in multiline loops. Style/For: @@ -268,7 +262,7 @@ Style/HashSyntax: - hash_rockets # Checks the indentation of the first key in a hash literal. -Layout/IndentFirstHashElement: +Layout/FirstHashElementIndentation: # The value `special_inside_parentheses` means that hash literals with braces # that have their opening brace on the same line as a surrounding opening # round parenthesis, shall have their first key indented relative to the @@ -293,7 +287,6 @@ Metrics/LineLength: Exclude: - config/routes.rb - Style/Next: # With `always` all conditions at the end of an iteration needs to be # replace by next - with `skip_modifier_ifs` the modifier if like this one @@ -319,7 +312,7 @@ Style/MethodDefParentheses: - require_no_parentheses Metrics/MethodLength: - CountComments: false # count full line comments? + CountComments: false # count full line comments? Max: 10 Naming/MethodName: @@ -341,18 +334,18 @@ Style/ParenthesesAroundCondition: Style/PercentLiteralDelimiters: PreferredDelimiters: - '%': () - '%i': () - '%q': () - '%Q': () - '%r': '{}' - '%s': () - '%w': () - '%W': () - '%x': () + "%": () + "%i": () + "%q": () + "%Q": () + "%r": "{}" + "%s": () + "%w": () + "%W": () + "%x": () Naming/PredicateName: - NamePrefixBlacklist: + ForbiddenPrefixes: - get_ Style/RaiseArgs: @@ -361,7 +354,6 @@ Style/RaiseArgs: - compact # raise Exception.new(msg) - exploded # raise Exception, msg - Style/RedundantReturn: # When true allows code like `return x, y`. AllowMultipleReturnValues: false @@ -382,7 +374,6 @@ Style/SignalException: - only_fail - semantic - Style/SingleLineBlockParams: Methods: - reduce: @@ -430,7 +421,7 @@ Layout/SpaceInsideHashLiteralBraces: - space - no_space -Layout/TrailingBlankLines: +Layout/TrailingEmptyLines: EnforcedStyle: final_newline SupportedStyles: - final_newline @@ -483,7 +474,7 @@ Style/TrivialAccessors: # # Commonly used in DSLs AllowDSLWriters: false - Whitelist: + AllowedMethods: - to_ary - to_a - to_c diff --git a/api/.rubocop_enabled.yml b/api/.rubocop_enabled.yml index 22aea2c..13ff481 100644 --- a/api/.rubocop_enabled.yml +++ b/api/.rubocop_enabled.yml @@ -8,16 +8,16 @@ Style/Alias: Description: "Use alias_method instead of alias." Enabled: true -Layout/AlignHash: +Layout/HashAlignment: Description: >- - Align the elements of a hash literal if they span more than - one line. + Align the elements of a hash literal if they span more than + one line. Enabled: true -Layout/AlignParameters: +Layout/ParameterAlignment: Description: >- - Align the parameters of a method call if they span more - than one line. + Align the parameters of a method call if they span more + than one line. Enabled: true Style/AndOr: @@ -54,13 +54,9 @@ Metrics/BlockNesting: Style/BlockDelimiters: Description: >- - Avoid using {...} for multi-line blocks (multiline chaining is - always ugly). - Prefer {...} over do...end for single-line blocks. - Enabled: true - -Style/BracesAroundHashParameters: - Description: "Enforce braces style inside hash parameters." + Avoid using {...} for multi-line blocks (multiline chaining is + always ugly). + Prefer {...} over do...end for single-line blocks. Enabled: true Style/CaseEquality: @@ -105,8 +101,8 @@ Style/ColonMethodCall: Style/CommentAnnotation: Description: >- - Checks formatting of special comments - (TODO, FIXME, OPTIMIZE, HACK, REVIEW). + Checks formatting of special comments + (TODO, FIXME, OPTIMIZE, HACK, REVIEW). Enabled: true Layout/CommentIndentation: @@ -211,14 +207,14 @@ Style/GuardClause: Style/HashSyntax: Description: >- - Prefer Ruby 1.9 hash syntax { a: 1, b: 2 } over 1.8 syntax - { :a => 1, :b => 2 }. + Prefer Ruby 1.9 hash syntax { a: 1, b: 2 } over 1.8 syntax + { :a => 1, :b => 2 }. Enabled: true Style/IfUnlessModifier: Description: >- - Favor modifier if/unless usage when you have a - single-line body. + Favor modifier if/unless usage when you have a + single-line body. Enabled: true Style/IfWithSemicolon: @@ -233,13 +229,13 @@ Layout/IndentationWidth: Description: "Use 2 spaces for indentation." Enabled: true -Layout/IndentFirstArrayElement: +Layout/FirstArrayElementIndentation: Description: >- - Checks the indentation of the first element in an array - literal. + Checks the indentation of the first element in an array + literal. Enabled: true -Layout/IndentFirstHashElement: +Layout/FirstHashElementIndentation: Description: "Checks the indentation of the first key in a hash literal." Enabled: true @@ -257,8 +253,8 @@ Layout/LeadingCommentSpace: Style/LineEndConcatenation: Description: >- - Use \ instead of + or << to concatenate two string literals at - line end. + Use \ instead of + or << to concatenate two string literals at + line end. Enabled: true Metrics/LineLength: @@ -271,8 +267,8 @@ Style/MethodCallWithoutArgsParentheses: Style/MethodDefParentheses: Description: >- - Checks if the method definitions have or don"t have - parentheses. + Checks if the method definitions have or don"t have + parentheses. Enabled: true Naming/MethodName: @@ -293,14 +289,14 @@ Style/MultilineIfThen: Style/MultilineTernaryOperator: Description: >- - Avoid multi-line ?: (the ternary operator); - use if/unless instead. + Avoid multi-line ?: (the ternary operator); + use if/unless instead. Enabled: true Style/NegatedIf: Description: >- - Favor unless over if for negative conditions - (or control flow or). + Favor unless over if for negative conditions + (or control flow or). Enabled: true Style/NegatedWhile: @@ -329,14 +325,14 @@ Style/Not: Style/NumericLiterals: Description: >- - Add underscores to large numeric literals to improve their - readability. + Add underscores to large numeric literals to improve their + readability. Enabled: true Style/OneLineConditional: Description: >- - Favor the ternary operator(?:) over - if/then/else/end constructs. + Favor the ternary operator(?:) over + if/then/else/end constructs. Enabled: true Naming/BinaryOperatorParameterName: @@ -345,8 +341,8 @@ Naming/BinaryOperatorParameterName: Style/ParenthesesAroundCondition: Description: >- - Don't use parentheses around the condition of an - if/unless/while. + Don't use parentheses around the condition of an + if/unless/while. Enabled: true Style/PercentLiteralDelimiters: @@ -387,10 +383,10 @@ Style/RedundantSelf: Style/RegexpLiteral: Description: >- - Use %r for regular expressions matching more than - `MaxSlashes` '/' characters. - Use %r only for regular expressions matching more than - `MaxSlashes` '/' character. + Use %r for regular expressions matching more than + `MaxSlashes` '/' characters. + Use %r only for regular expressions matching more than + `MaxSlashes` '/' character. Enabled: true Style/RescueModifier: @@ -419,8 +415,8 @@ Style/SingleLineMethods: Layout/SpaceBeforeFirstArg: Description: >- - Checks that exactly one space is used between a method name - and the first argument for method calls without parentheses. + Checks that exactly one space is used between a method name + and the first argument for method calls without parentheses. Enabled: true Layout/SpaceAfterColon: @@ -437,8 +433,8 @@ Layout/SpaceAroundKeyword: Layout/SpaceAfterMethodName: Description: >- - Never put a space between a method name and the opening - parenthesis in a method definition. + Never put a space between a method name and the opening + parenthesis in a method definition. Enabled: true Layout/SpaceAfterNot: @@ -451,8 +447,8 @@ Layout/SpaceAfterSemicolon: Layout/SpaceBeforeBlockBraces: Description: >- - Checks that the left block brace has or doesn't have space - before it. + Checks that the left block brace has or doesn't have space + before it. Enabled: true Layout/SpaceBeforeComma: @@ -461,8 +457,8 @@ Layout/SpaceBeforeComma: Layout/SpaceBeforeComment: Description: >- - Checks for missing space between code and a comment on the - same line. + Checks for missing space between code and a comment on the + same line. Enabled: true Layout/SpaceBeforeSemicolon: @@ -471,16 +467,16 @@ Layout/SpaceBeforeSemicolon: Layout/SpaceInsideBlockBraces: Description: >- - Checks that block braces have or don't have surrounding space. - For blocks taking parameters, checks that the left brace has - or doesn"t have trailing space. + Checks that block braces have or don't have surrounding space. + For blocks taking parameters, checks that the left brace has + or doesn"t have trailing space. Enabled: true Layout/SpaceAroundEqualsInParameterDefault: Description: >- - Checks that the equals signs in parameter default assignments - have or don't have surrounding space depending on - configuration. + Checks that the equals signs in parameter default assignments + have or don't have surrounding space depending on + configuration. Enabled: true Layout/SpaceAroundOperators: @@ -503,26 +499,26 @@ Style/StringLiterals: Description: "Checks if uses of quotes match the configured preference." Enabled: true -Layout/Tab: +Layout/IndentationStyle: Description: "No hard tabs." Enabled: true -Layout/TrailingBlankLines: +Layout/TrailingEmptyLines: Description: "Checks trailing blank lines and final newline." Enabled: true Style/TrailingCommaInArguments: - Description: 'Checks for trailing comma in argument lists.' - StyleGuide: '#no-trailing-params-comma' + Description: "Checks for trailing comma in argument lists." + StyleGuide: "#no-trailing-params-comma" Enabled: true Style/TrailingCommaInArrayLiteral: - Description: 'Checks for trailing comma in array literals.' - StyleGuide: '#no-trailing-array-commas' + Description: "Checks for trailing comma in array literals." + StyleGuide: "#no-trailing-array-commas" Enabled: true Style/TrailingCommaInHashLiteral: - Description: 'Checks for trailing comma in hash literals.' + Description: "Checks for trailing comma in hash literals." Enabled: true Layout/TrailingWhitespace: @@ -535,11 +531,11 @@ Style/TrivialAccessors: Style/UnlessElse: Description: >- - Never use unless with else. Rewrite these with the positive - case first. + Never use unless with else. Rewrite these with the positive + case first. Enabled: true -Style/UnneededCapitalW: +Style/RedundantCapitalW: Description: "Checks for %W when interpolation is not needed." Enabled: true @@ -549,8 +545,8 @@ Style/CommandLiteral: Style/VariableInterpolation: Description: >- - Don't interpolate global, instance and class variables - directly in strings. + Don't interpolate global, instance and class variables + directly in strings. Enabled: true Naming/VariableName: @@ -567,8 +563,8 @@ Style/WhileUntilDo: Style/WhileUntilModifier: Description: >- - Favor modifier while/until usage when you have a - single-line body. + Favor modifier while/until usage when you have a + single-line body. Enabled: true Style/WordArray: @@ -580,14 +576,14 @@ Style/WordArray: Lint/AmbiguousOperator: Description: >- - Checks for ambiguous operators in the first argument of a - method invocation without parentheses. + Checks for ambiguous operators in the first argument of a + method invocation without parentheses. Enabled: true Lint/AmbiguousRegexpLiteral: Description: >- - Checks for ambiguous regexp literals in the first argument of - a method invocation without parenthesis. + Checks for ambiguous regexp literals in the first argument of + a method invocation without parenthesis. Enabled: true Layout/BlockAlignment: @@ -626,10 +622,6 @@ Layout/EndAlignment: Description: "Align ends correctly." Enabled: true -Lint/EndInMethod: - Description: "END blocks should not be placed inside method definitions." - Enabled: true - Lint/EnsureReturn: Description: "Never use return in an ensure block." Enabled: true @@ -638,7 +630,7 @@ Security/Eval: Description: "The use of eval represents a serious security risk." Enabled: true -Lint/HandleExceptions: +Lint/SuppressedException: Description: "Don't suppress exception." Enabled: true @@ -648,20 +640,20 @@ Lint/LiteralInInterpolation: Lint/Loop: Description: >- - Use Kernel#loop with break rather than begin/end/until or - begin/end/while for post-loop tests. + Use Kernel#loop with break rather than begin/end/until or + begin/end/while for post-loop tests. Enabled: true Lint/ParenthesesAsGroupedExpression: Description: >- - Checks for method calls with a space before the opening - parenthesis. + Checks for method calls with a space before the opening + parenthesis. Enabled: true Lint/RequireParentheses: Description: >- - Use parentheses in the method call to avoid confusion - about precedence. + Use parentheses in the method call to avoid confusion + about precedence. Enabled: true Lint/RescueException: @@ -670,11 +662,11 @@ Lint/RescueException: Lint/ShadowingOuterLocalVariable: Description: >- - Do not use the same name as outer local variable - for block arguments or block local variables. + Do not use the same name as outer local variable + for block arguments or block local variables. Enabled: true -Lint/StringConversionInInterpolation: +Lint/RedundantStringCoercion: Description: "Checks for Object#to_s usage in string interpolation." Enabled: true diff --git a/api/Gemfile b/api/Gemfile index 5d75f01..5c9ee5a 100644 --- a/api/Gemfile +++ b/api/Gemfile @@ -9,7 +9,7 @@ gem 'sqlite3', '~> 1.4' gem 'puma', '~> 4.1' gem "rails_best_practices" gem "reek" -gem 'rubocop', '~> 0.54.0', require: false +gem 'rubocop', require: false gem "rspec-rails" gem "rubocop-checkstyle_formatter", require: false # Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder From 1038c5f6907ff42cfa8d7441bae26de0d5c29272 Mon Sep 17 00:00:00 2001 From: Hugh Do Date: Wed, 12 Aug 2020 14:38:33 +0700 Subject: [PATCH 13/49] commit 26 --- api/Gemfile | 1 + 1 file changed, 1 insertion(+) diff --git a/api/Gemfile b/api/Gemfile index 5c9ee5a..ffa6690 100644 --- a/api/Gemfile +++ b/api/Gemfile @@ -10,6 +10,7 @@ gem 'puma', '~> 4.1' gem "rails_best_practices" gem "reek" gem 'rubocop', require: false +gem "rubocop-rails", "~> 2.3.2", require: false gem "rspec-rails" gem "rubocop-checkstyle_formatter", require: false # Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder From 938f881530a9e9b08ae301c687a2e414fcff0fdd Mon Sep 17 00:00:00 2001 From: Hugh Do Date: Wed, 12 Aug 2020 14:47:12 +0700 Subject: [PATCH 14/49] commit 26 --- api/.rubocop.yml | 2 +- api/.rubocop_enabled.yml | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/api/.rubocop.yml b/api/.rubocop.yml index 34f725f..44a9c53 100644 --- a/api/.rubocop.yml +++ b/api/.rubocop.yml @@ -281,7 +281,7 @@ Style/LambdaCall: - call - braces -Metrics/LineLength: +Layout/LineLength: Max: 80 AllowURI: true Exclude: diff --git a/api/.rubocop_enabled.yml b/api/.rubocop_enabled.yml index 13ff481..c454d34 100644 --- a/api/.rubocop_enabled.yml +++ b/api/.rubocop_enabled.yml @@ -257,7 +257,7 @@ Style/LineEndConcatenation: line end. Enabled: true -Metrics/LineLength: +Layout/LineLength: Description: "Limit lines to 80 characters." Enabled: true @@ -694,10 +694,6 @@ Lint/UselessAssignment: Description: "Checks for useless assignment to a local variable." Enabled: true -Lint/UselessComparison: - Description: "Checks for comparison of something with itself." - Enabled: true - Lint/UselessElseWithoutRescue: Description: "Checks for useless `else` in `begin..end` without `rescue`." Enabled: true @@ -710,6 +706,10 @@ Lint/Void: Description: "Possible use of operator/literal/variable in void context." Enabled: true +Lint/AmbiguousBlockAssociation: + Description: "This cop checks for ambiguous block association with method when param passed without parentheses." + Enabled: true + ##################### Rails ################################## Rails/ActionFilter: From 48cd3400f2b859c65b63ecb078de38d603c56cb9 Mon Sep 17 00:00:00 2001 From: Hugh Do Date: Wed, 12 Aug 2020 14:49:59 +0700 Subject: [PATCH 15/49] commit 27 --- api/.rubocop_disabled.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/api/.rubocop_disabled.yml b/api/.rubocop_disabled.yml index 6a7dd7c..e02c876 100644 --- a/api/.rubocop_disabled.yml +++ b/api/.rubocop_disabled.yml @@ -2,8 +2,8 @@ Style/FrozenStringLiteralComment: Description: >- - Add the frozen_string_literal comment to the top of files - to help transition from Ruby 2.3.0 to Ruby 3.0. + Add the frozen_string_literal comment to the top of files + to help transition from Ruby 2.3.0 to Ruby 3.0. Enabled: false Style/InlineComment: @@ -50,13 +50,13 @@ Metrics/CyclomaticComplexity: Description: "Avoid complex methods." Enabled: false -Layout/AlignArray: +Layout/ArrayAlignment: Description: >- - Align the elements of an array literal if they span more than - one line. + Align the elements of an array literal if they span more than + one line. Enabled: false -Style/UnneededPercentQ: +Style/RedundantPercentQ: Description: "Checks for %q/%Q when single quotes or double quotes would do." Enabled: false From 660d1bac381a2e196110144772299e8966603e1e Mon Sep 17 00:00:00 2001 From: Hugh Do Date: Thu, 13 Aug 2020 10:22:29 +0700 Subject: [PATCH 16/49] commit 28 --- .DS_Store | Bin 6148 -> 6148 bytes .github/workflows/deployment.yml | 2 +- api/Gemfile | 58 +++++++++++-------------------- 3 files changed, 21 insertions(+), 39 deletions(-) diff --git a/.DS_Store b/.DS_Store index a1117b23332ed9331a855e159cf83d031b73d6a4..44875d561490aaf0b590fa98ef6c43ae50d70945 100644 GIT binary patch delta 21 ccmZoMXffEJ$jV`1YOJGRVraQpll8U`06z2up8x;= delta 21 ccmZoMXffEJ$jV`AXsDxLVrjZrll8U`06wP$ng9R* diff --git a/.github/workflows/deployment.yml b/.github/workflows/deployment.yml index 7b0f216..8f1bcbd 100644 --- a/.github/workflows/deployment.yml +++ b/.github/workflows/deployment.yml @@ -11,7 +11,7 @@ jobs: run: sudo gem install bundler:1.17.2 - run: | cd api - bundle install + bundle install --with development - run: | pwd - name: Rubocop diff --git a/api/Gemfile b/api/Gemfile index ffa6690..37245c6 100644 --- a/api/Gemfile +++ b/api/Gemfile @@ -1,45 +1,27 @@ -source 'https://rubygems.org' -git_source(:github) { |repo| "https://github.com/#{repo}.git" } +source "https://rubygems.org" +git_source(:github){|repo| "https://github.com/#{repo}.git"} -# Bundle edge Rails instead: gem 'rails', github: 'rails/rails' -gem 'rails', '~> 6.0.3', '>= 6.0.3.2' -# Use sqlite3 as the database for Active Record -gem 'sqlite3', '~> 1.4' -# Use Puma as the app server -gem 'puma', '~> 4.1' -gem "rails_best_practices" -gem "reek" -gem 'rubocop', require: false -gem "rubocop-rails", "~> 2.3.2", require: false -gem "rspec-rails" -gem "rubocop-checkstyle_formatter", require: false -# Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder -# gem 'jbuilder', '~> 2.7' -# Use Redis adapter to run Action Cable in production -# gem 'redis', '~> 4.0' -# Use Active Model has_secure_password -# gem 'bcrypt', '~> 3.1.7' +gem "bootsnap", ">= 1.4.2", require: false +gem "mysql2", ">= 0.4.4" +gem "puma", "~> 4.1" +gem "rails", "~> 6.0.3", ">= 6.0.3.2" -# Use Active Storage variant -# gem 'image_processing', '~> 1.2' - -# Reduces boot times through caching; required in config/boot.rb -gem 'bootsnap', '>= 1.4.2', require: false - -# Use Rack CORS for handling Cross-Origin Resource Sharing (CORS), making cross-origin AJAX possible -# gem 'rack-cors' - -group :development, :test do - # Call 'byebug' anywhere in the code to stop execution and get a debugger console - gem 'byebug', platforms: [:mri, :mingw, :x64_mingw] +group :development do + gem "listen", "~> 3.2" + gem "spring" + gem "spring-watcher-listen", "~> 2.0.0" end group :development do - gem 'listen', '~> 3.2' - # 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.0' + gem "rails_best_practices" + gem "reek" + gem "rubocop", require: false + gem "rubocop-rails", "~> 2.3.2", require: false end -# Windows does not include zoneinfo files, so bundle the tzinfo-data gem -gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw, :jruby] +gem "tzinfo-data", platforms: [:mingw, :mswin, :x64_mingw, :jruby] + +group :development, :test do + gem "factory_bot_rails" + gem "rspec-rails" +end From 021f85316c892700eed6e2484794bd794c5c1810 Mon Sep 17 00:00:00 2001 From: Hugh Do Date: Thu, 13 Aug 2020 10:51:58 +0700 Subject: [PATCH 17/49] commit 29 --- api/.rubocop.yml | 2 +- api/.rubocop_enabled.yml | 2 +- api/Rakefile | 2 +- api/app/mailers/application_mailer.rb | 4 ++-- api/bin/bundle | 32 +++++++++++++++----------- api/bin/rails | 10 ++++---- api/bin/rake | 8 +++---- api/bin/setup | 18 +++++++-------- api/bin/spring | 10 ++++---- api/config.ru | 2 +- api/config/application.rb | 2 +- api/config/boot.rb | 6 ++--- api/config/environment.rb | 2 +- api/config/environments/development.rb | 5 ++-- api/config/environments/production.rb | 6 ++--- api/config/environments/test.rb | 2 +- api/config/puma.rb | 10 ++++---- api/test/test_helper.rb | 6 ++--- 18 files changed, 67 insertions(+), 62 deletions(-) diff --git a/api/.rubocop.yml b/api/.rubocop.yml index 44a9c53..f112114 100644 --- a/api/.rubocop.yml +++ b/api/.rubocop.yml @@ -282,7 +282,7 @@ Style/LambdaCall: - braces Layout/LineLength: - Max: 80 + Max: 120 AllowURI: true Exclude: - config/routes.rb diff --git a/api/.rubocop_enabled.yml b/api/.rubocop_enabled.yml index c454d34..c33bc7c 100644 --- a/api/.rubocop_enabled.yml +++ b/api/.rubocop_enabled.yml @@ -258,7 +258,7 @@ Style/LineEndConcatenation: Enabled: true Layout/LineLength: - Description: "Limit lines to 80 characters." + Description: "Limit lines to 120 characters." Enabled: true Style/MethodCallWithoutArgsParentheses: diff --git a/api/Rakefile b/api/Rakefile index e85f913..9a5ea73 100644 --- a/api/Rakefile +++ b/api/Rakefile @@ -1,6 +1,6 @@ # Add your own tasks in files placed in lib/tasks ending in .rake, # for example lib/tasks/capistrano.rake, and they will automatically be available to Rake. -require_relative 'config/application' +require_relative "config/application" Rails.application.load_tasks diff --git a/api/app/mailers/application_mailer.rb b/api/app/mailers/application_mailer.rb index 286b223..3c34c81 100644 --- a/api/app/mailers/application_mailer.rb +++ b/api/app/mailers/application_mailer.rb @@ -1,4 +1,4 @@ class ApplicationMailer < ActionMailer::Base - default from: 'from@example.com' - layout 'mailer' + default from: "from@example.com" + layout "mailer" end diff --git a/api/bin/bundle b/api/bin/bundle index 524dfd3..50f94d7 100755 --- a/api/bin/bundle +++ b/api/bin/bundle @@ -11,7 +11,7 @@ require "rubygems" m = Module.new do - module_function + module_function def invoked_as_script? File.expand_path($0) == File.expand_path(__FILE__) @@ -23,15 +23,17 @@ m = Module.new do def cli_arg_version return unless invoked_as_script? # don't want to hijack other binstubs - return unless "update".start_with?(ARGV.first || " ") # must be running `bundle update` + unless "update".start_with?(ARGV.first || " ") + return + end # must be running `bundle update` + bundler_version = nil update_index = nil ARGV.each_with_index do |a, i| - if update_index && update_index.succ == i && a =~ Gem::Version::ANCHORED_VERSION_PATTERN - bundler_version = a - end + bundler_version = a if update_index && update_index.succ == i && a =~ Gem::Version::ANCHORED_VERSION_PATTERN next unless a =~ /\A--bundler(?:[= ](#{Gem::Version::VERSION_PATTERN}))?\z/ - bundler_version = $1 || ">= 0.a" + + bundler_version = Regexp.last_match(1) || ">= 0.a" update_index = i end bundler_version @@ -39,9 +41,9 @@ m = Module.new do def gemfile gemfile = ENV["BUNDLE_GEMFILE"] - return gemfile if gemfile && !gemfile.empty? + return gemfile if gemfile.present? - File.expand_path("../../Gemfile", __FILE__) + File.expand_path("../Gemfile", __dir__) end def lockfile @@ -55,8 +57,10 @@ m = Module.new do def lockfile_version return unless File.file?(lockfile) + lockfile_contents = File.read(lockfile) return unless lockfile_contents =~ /\n\nBUNDLED WITH\n\s{2,}(#{Gem::Version::VERSION_PATTERN})\n/ + Regexp.last_match(1) end @@ -74,7 +78,7 @@ m = Module.new do activate_bundler(bundler_version.dup) end - def activate_bundler(bundler_version) + def activate_bundler bundler_version if Gem::Version.correct?(bundler_version) && Gem::Version.new(bundler_version).release < Gem::Version.new("2.0") bundler_version = "< 2" end @@ -82,10 +86,14 @@ m = Module.new do gem "bundler", bundler_version end return if gem_error.nil? + require_error = activation_error_handling do require "bundler/version" end - return if require_error.nil? && Gem::Requirement.new(bundler_version).satisfied_by?(Gem::Version.new(Bundler::VERSION)) + if require_error.nil? && Gem::Requirement.new(bundler_version).satisfied_by?(Gem::Version.new(Bundler::VERSION)) + return + end + warn "Activating bundler (#{bundler_version}) failed:\n#{gem_error.message}\n\nTo install the version of bundler this project requires, run `gem install bundler -v '#{bundler_version}'`" exit 42 end @@ -100,6 +108,4 @@ end m.load_bundler! -if m.invoked_as_script? - load Gem.bin_path("bundler", "bundle") -end +load Gem.bin_path("bundler", "bundle") if m.invoked_as_script? diff --git a/api/bin/rails b/api/bin/rails index 5badb2f..36b01a1 100755 --- a/api/bin/rails +++ b/api/bin/rails @@ -1,9 +1,9 @@ #!/usr/bin/env ruby begin - load File.expand_path('../spring', __FILE__) + load File.expand_path("spring", __dir__) rescue LoadError => e - raise unless e.message.include?('spring') + raise unless e.message.include?("spring") end -APP_PATH = File.expand_path('../config/application', __dir__) -require_relative '../config/boot' -require 'rails/commands' +APP_PATH = File.expand_path("../config/application", __dir__) +require_relative "../config/boot" +require "rails/commands" diff --git a/api/bin/rake b/api/bin/rake index d87d5f5..660472a 100755 --- a/api/bin/rake +++ b/api/bin/rake @@ -1,9 +1,9 @@ #!/usr/bin/env ruby begin - load File.expand_path('../spring', __FILE__) + load File.expand_path("spring", __dir__) rescue LoadError => e - raise unless e.message.include?('spring') + raise unless e.message.include?("spring") end -require_relative '../config/boot' -require 'rake' +require_relative "../config/boot" +require "rake" Rake.application.run diff --git a/api/bin/setup b/api/bin/setup index 0e39e8c..59536c4 100755 --- a/api/bin/setup +++ b/api/bin/setup @@ -1,10 +1,10 @@ #!/usr/bin/env ruby -require 'fileutils' +require "fileutils" # path to your application root. -APP_ROOT = File.expand_path('..', __dir__) +APP_ROOT = File.expand_path("..", __dir__) -def system!(*args) +def system! *args system(*args) || abort("\n== Command #{args} failed ==") end @@ -13,9 +13,9 @@ FileUtils.chdir APP_ROOT do # This script is idempotent, so that you can run it at anytime and get an expectable outcome. # Add necessary setup steps to this file. - puts '== Installing dependencies ==' - system! 'gem install bundler --conservative' - system('bundle check') || system!('bundle install') + puts "== Installing dependencies ==" + system! "gem install bundler --conservative" + system("bundle check") || system!("bundle install") # puts "\n== Copying sample files ==" # unless File.exist?('config/database.yml') @@ -23,11 +23,11 @@ FileUtils.chdir APP_ROOT do # end puts "\n== Preparing database ==" - system! 'bin/rails db:prepare' + system! "bin/rails db:prepare" puts "\n== Removing old logs and tempfiles ==" - system! 'bin/rails log:clear tmp:clear' + system! "bin/rails log:clear tmp:clear" puts "\n== Restarting application server ==" - system! 'bin/rails restart' + system! "bin/rails restart" end diff --git a/api/bin/spring b/api/bin/spring index d89ee49..de47257 100755 --- a/api/bin/spring +++ b/api/bin/spring @@ -4,14 +4,14 @@ # It gets overwritten when you run the `spring binstub` command. unless defined?(Spring) - require 'rubygems' - require 'bundler' + require "rubygems" + require "bundler" lockfile = Bundler::LockfileParser.new(Bundler.default_lockfile.read) - spring = lockfile.specs.detect { |spec| spec.name == 'spring' } + spring = lockfile.specs.detect{|spec| spec.name == "spring"} if spring Gem.use_paths Gem.dir, Bundler.bundle_path.to_s, *Gem.path - gem 'spring', spring.version - require 'spring/binstub' + gem "spring", spring.version + require "spring/binstub" end end diff --git a/api/config.ru b/api/config.ru index f7ba0b5..441e6ff 100644 --- a/api/config.ru +++ b/api/config.ru @@ -1,5 +1,5 @@ # This file is used by Rack-based servers to start the application. -require_relative 'config/environment' +require_relative "config/environment" run Rails.application diff --git a/api/config/application.rb b/api/config/application.rb index 890387e..3c9702f 100644 --- a/api/config/application.rb +++ b/api/config/application.rb @@ -1,4 +1,4 @@ -require_relative 'boot' +require_relative "boot" require "rails" # Pick the frameworks you want: diff --git a/api/config/boot.rb b/api/config/boot.rb index b9e460c..988a5dd 100644 --- a/api/config/boot.rb +++ b/api/config/boot.rb @@ -1,4 +1,4 @@ -ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../Gemfile', __dir__) +ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../Gemfile", __dir__) -require 'bundler/setup' # Set up gems listed in the Gemfile. -require 'bootsnap/setup' # Speed up boot time by caching expensive operations. +require "bundler/setup" # Set up gems listed in the Gemfile. +require "bootsnap/setup" # Speed up boot time by caching expensive operations. diff --git a/api/config/environment.rb b/api/config/environment.rb index 426333b..cac5315 100644 --- a/api/config/environment.rb +++ b/api/config/environment.rb @@ -1,5 +1,5 @@ # Load the Rails application. -require_relative 'application' +require_relative "application" # Initialize the Rails application. Rails.application.initialize! diff --git a/api/config/environments/development.rb b/api/config/environments/development.rb index 698f159..7827545 100644 --- a/api/config/environments/development.rb +++ b/api/config/environments/development.rb @@ -14,10 +14,10 @@ # Enable/disable caching. By default caching is disabled. # Run rails dev:cache to toggle caching. - if Rails.root.join('tmp', 'caching-dev.txt').exist? + if Rails.root.join("tmp", "caching-dev.txt").exist? config.cache_store = :memory_store config.public_file_server.headers = { - 'Cache-Control' => "public, max-age=#{2.days.to_i}" + "Cache-Control" => "public, max-age=#{2.days.to_i}" } else config.action_controller.perform_caching = false @@ -42,7 +42,6 @@ # Highlight code that triggered database queries in logs. config.active_record.verbose_query_logs = true - # Raises error for missing translations. # config.action_view.raise_on_missing_translations = true diff --git a/api/config/environments/production.rb b/api/config/environments/production.rb index 8cb401a..4f7c45b 100644 --- a/api/config/environments/production.rb +++ b/api/config/environments/production.rb @@ -11,7 +11,7 @@ config.eager_load = true # Full error reports are disabled and caching is turned on. - config.consider_all_requests_local = false + config.consider_all_requests_local = false # Ensures that a master key has been made available in either ENV["RAILS_MASTER_KEY"] # or in config/master.key. This key is used to decrypt credentials (and other encrypted files). @@ -19,7 +19,7 @@ # Disable serving static files from the `/public` folder by default since # Apache or NGINX already handles this. - config.public_file_server.enabled = ENV['RAILS_SERVE_STATIC_FILES'].present? + config.public_file_server.enabled = ENV["RAILS_SERVE_STATIC_FILES"].present? # Enable serving of images, stylesheets, and JavaScripts from an asset server. # config.action_controller.asset_host = 'http://assets.example.com' @@ -44,7 +44,7 @@ config.log_level = :debug # Prepend all log lines with the following tags. - config.log_tags = [ :request_id ] + config.log_tags = [:request_id] # Use a different cache store in production. # config.cache_store = :mem_cache_store diff --git a/api/config/environments/test.rb b/api/config/environments/test.rb index 0cb2424..db5f9d6 100644 --- a/api/config/environments/test.rb +++ b/api/config/environments/test.rb @@ -17,7 +17,7 @@ # Configure public file server for tests with Cache-Control for performance. config.public_file_server.enabled = true config.public_file_server.headers = { - 'Cache-Control' => "public, max-age=#{1.hour.to_i}" + "Cache-Control" => "public, max-age=#{1.hour.to_i}" } # Show full error reports and disable caching. diff --git a/api/config/puma.rb b/api/config/puma.rb index 5ed4437..d91a8e6 100644 --- a/api/config/puma.rb +++ b/api/config/puma.rb @@ -4,20 +4,20 @@ # the maximum value specified for Puma. Default is set to 5 threads for minimum # and maximum; this matches the default thread size of Active Record. # -max_threads_count = ENV.fetch("RAILS_MAX_THREADS") { 5 } -min_threads_count = ENV.fetch("RAILS_MIN_THREADS") { max_threads_count } +max_threads_count = ENV.fetch("RAILS_MAX_THREADS"){5} +min_threads_count = ENV.fetch("RAILS_MIN_THREADS"){max_threads_count} threads min_threads_count, max_threads_count # Specifies the `port` that Puma will listen on to receive requests; default is 3000. # -port ENV.fetch("PORT") { 3000 } +port ENV.fetch("PORT"){3000} # Specifies the `environment` that Puma will run in. # -environment ENV.fetch("RAILS_ENV") { "development" } +environment ENV.fetch("RAILS_ENV"){"development"} # Specifies the `pidfile` that Puma will use. -pidfile ENV.fetch("PIDFILE") { "tmp/pids/server.pid" } +pidfile ENV.fetch("PIDFILE"){"tmp/pids/server.pid"} # Specifies the number of `workers` to boot in clustered mode. # Workers are forked web server processes. If using threads and workers together diff --git a/api/test/test_helper.rb b/api/test/test_helper.rb index d5300f8..d713e37 100644 --- a/api/test/test_helper.rb +++ b/api/test/test_helper.rb @@ -1,6 +1,6 @@ -ENV['RAILS_ENV'] ||= 'test' -require_relative '../config/environment' -require 'rails/test_help' +ENV["RAILS_ENV"] ||= "test" +require_relative "../config/environment" +require "rails/test_help" class ActiveSupport::TestCase # Run tests in parallel with specified workers From 99a5a88888bd9587636078a02b27178cd2654b3e Mon Sep 17 00:00:00 2001 From: Hugh Do Date: Thu, 13 Aug 2020 10:54:44 +0700 Subject: [PATCH 18/49] commit 30 --- api/.rspec | 1 - api/Gemfile | 2 +- api/Gemfile.lock | 82 +++++++++++++++++++++++++++++++--- api/config/database.yml | 47 ++++++++++++++++---- api/spec/rails_helper.rb | 64 +++++++++++++++++++++++++++ api/spec/spec_helper.rb | 96 ++++++++++++++++++++++++++++++++++++++++ 6 files changed, 274 insertions(+), 18 deletions(-) create mode 100644 api/spec/rails_helper.rb create mode 100644 api/spec/spec_helper.rb diff --git a/api/.rspec b/api/.rspec index 83e16f8..c99d2e7 100644 --- a/api/.rspec +++ b/api/.rspec @@ -1,2 +1 @@ ---color --require spec_helper diff --git a/api/Gemfile b/api/Gemfile index 37245c6..10e8a5b 100644 --- a/api/Gemfile +++ b/api/Gemfile @@ -2,7 +2,7 @@ source "https://rubygems.org" git_source(:github){|repo| "https://github.com/#{repo}.git"} gem "bootsnap", ">= 1.4.2", require: false -gem "mysql2", ">= 0.4.4" +gem 'mysql2', '>= 0.4.4' gem "puma", "~> 4.1" gem "rails", "~> 6.0.3", ">= 6.0.3.2" diff --git a/api/Gemfile.lock b/api/Gemfile.lock index 2a491e6..20d7721 100644 --- a/api/Gemfile.lock +++ b/api/Gemfile.lock @@ -56,18 +56,29 @@ GEM minitest (~> 5.1) tzinfo (~> 1.1) zeitwerk (~> 2.2, >= 2.2.2) + ast (2.4.1) bootsnap (1.4.8) msgpack (~> 1.0) builder (3.2.4) - byebug (11.1.3) + code_analyzer (0.5.2) + sexp_processor concurrent-ruby (1.1.7) crass (1.0.6) + diff-lcs (1.4.4) erubi (1.9.0) + erubis (2.7.0) + factory_bot (6.1.0) + activesupport (>= 5.0.0) + factory_bot_rails (6.1.0) + factory_bot (~> 6.1.0) + railties (>= 5.0.0) ffi (1.13.1) globalid (0.4.2) activesupport (>= 4.2.0) i18n (1.8.5) concurrent-ruby (~> 1.0) + json (2.3.1) + kwalify (0.7.2) listen (3.2.1) rb-fsevent (~> 0.10, >= 0.10.3) rb-inotify (~> 0.9, >= 0.9.10) @@ -84,9 +95,14 @@ GEM mini_portile2 (2.4.0) minitest (5.14.1) msgpack (1.3.3) + mysql2 (0.5.3) nio4r (2.5.2) nokogiri (1.10.10) mini_portile2 (~> 2.4.0) + parallel (1.19.2) + parser (2.7.1.4) + ast (~> 2.4.1) + psych (3.1.0) puma (4.3.5) nio4r (~> 2.0) rack (2.2.3) @@ -112,16 +128,66 @@ GEM nokogiri (>= 1.6) rails-html-sanitizer (1.3.0) loofah (~> 2.3) + rails_best_practices (1.20.0) + activesupport + code_analyzer (>= 0.5.1) + erubis + i18n + json + require_all (~> 3.0) + ruby-progressbar railties (6.0.3.2) actionpack (= 6.0.3.2) activesupport (= 6.0.3.2) method_source rake (>= 0.8.7) thor (>= 0.20.3, < 2.0) + rainbow (3.0.0) rake (13.0.1) rb-fsevent (0.10.4) rb-inotify (0.10.1) ffi (~> 1.0) + reek (6.0.1) + kwalify (~> 0.7.0) + parser (>= 2.5.0.0, < 2.8, != 2.5.1.1) + psych (~> 3.1.0) + rainbow (>= 2.0, < 4.0) + regexp_parser (1.7.1) + require_all (3.0.0) + rexml (3.2.4) + rspec-core (3.9.2) + rspec-support (~> 3.9.3) + rspec-expectations (3.9.2) + diff-lcs (>= 1.2.0, < 2.0) + rspec-support (~> 3.9.0) + rspec-mocks (3.9.1) + diff-lcs (>= 1.2.0, < 2.0) + rspec-support (~> 3.9.0) + rspec-rails (4.0.1) + actionpack (>= 4.2) + activesupport (>= 4.2) + railties (>= 4.2) + rspec-core (~> 3.9) + rspec-expectations (~> 3.9) + rspec-mocks (~> 3.9) + rspec-support (~> 3.9) + rspec-support (3.9.3) + rubocop (0.89.1) + parallel (~> 1.10) + parser (>= 2.7.1.1) + rainbow (>= 2.2.2, < 4.0) + regexp_parser (>= 1.7) + rexml + rubocop-ast (>= 0.3.0, < 1.0) + ruby-progressbar (~> 1.7) + unicode-display_width (>= 1.4.0, < 2.0) + rubocop-ast (0.3.0) + parser (>= 2.7.1.4) + rubocop-rails (2.3.2) + rack (>= 1.1) + rubocop (>= 0.72.0) + ruby-progressbar (1.10.1) + sexp_processor (4.15.0) spring (2.1.0) spring-watcher-listen (2.0.1) listen (>= 2.7, < 4.0) @@ -133,11 +199,11 @@ GEM actionpack (>= 4.0) activesupport (>= 4.0) sprockets (>= 3.0.0) - sqlite3 (1.4.2) thor (1.0.1) thread_safe (0.3.6) tzinfo (1.2.7) thread_safe (~> 0.1) + unicode-display_width (1.7.0) websocket-driver (0.7.3) websocket-extensions (>= 0.1.0) websocket-extensions (0.1.5) @@ -148,17 +214,19 @@ PLATFORMS DEPENDENCIES bootsnap (>= 1.4.2) - byebug + factory_bot_rails listen (~> 3.2) + mysql2 (>= 0.4.4) puma (~> 4.1) rails (~> 6.0.3, >= 6.0.3.2) + rails_best_practices + reek + rspec-rails + rubocop + rubocop-rails (~> 2.3.2) spring spring-watcher-listen (~> 2.0.0) - sqlite3 (~> 1.4) tzinfo-data -RUBY VERSION - ruby 2.6.3p62 - BUNDLED WITH 1.17.2 diff --git a/api/config/database.yml b/api/config/database.yml index 4a8a1b2..665eea6 100644 --- a/api/config/database.yml +++ b/api/config/database.yml @@ -1,25 +1,54 @@ -# SQLite. Versions 3.8.0 and up are supported. -# gem install sqlite3 +# MySQL. Versions 5.5.8 and up are supported. # -# Ensure the SQLite 3 gem is defined in your Gemfile -# gem 'sqlite3' +# Install the MySQL driver +# gem install mysql2 +# +# Ensure the MySQL gem is defined in your Gemfile +# gem 'mysql2' +# +# And be sure to use new-style password hashing: +# https://dev.mysql.com/doc/refman/5.7/en/password-hashing.html # default: &default - adapter: sqlite3 + adapter: mysql2 + encoding: utf8mb4 pool: <%= ENV.fetch("RAILS_MAX_THREADS") { 5 } %> - timeout: 5000 + username: root + password: + host: localhost development: <<: *default - database: db/development.sqlite3 + database: api_development # Warning: The database defined as "test" will be erased and # re-generated from your development database when you run "rake". # Do not set this db to the same as development or production. test: <<: *default - database: db/test.sqlite3 + database: api_test +# As with config/credentials.yml, you never want to store sensitive information, +# like your database password, in your source code. If your source code is +# ever seen by anyone, they now have access to your database. +# +# Instead, provide the password as a unix environment variable when you boot +# the app. Read https://guides.rubyonrails.org/configuring.html#configuring-a-database +# for a full rundown on how to provide these environment variables in a +# production deployment. +# +# On Heroku and other platform providers, you may have a full connection URL +# available as an environment variable. For example: +# +# DATABASE_URL="mysql2://myuser:mypass@localhost/somedatabase" +# +# You can use this database configuration with: +# +# production: +# url: <%= ENV['DATABASE_URL'] %> +# production: <<: *default - database: db/production.sqlite3 + database: api_production + username: api + password: <%= ENV['API_DATABASE_PASSWORD'] %> diff --git a/api/spec/rails_helper.rb b/api/spec/rails_helper.rb new file mode 100644 index 0000000..00345af --- /dev/null +++ b/api/spec/rails_helper.rb @@ -0,0 +1,64 @@ +# This file is copied to spec/ when you run 'rails generate rspec:install' +require 'spec_helper' +ENV['RAILS_ENV'] ||= 'test' +require File.expand_path('../config/environment', __dir__) +# Prevent database truncation if the environment is production +abort("The Rails environment is running in production mode!") if Rails.env.production? +require 'rspec/rails' +# Add additional requires below this line. Rails is not loaded until this point! + +# Requires supporting ruby files with custom matchers and macros, etc, in +# spec/support/ and its subdirectories. Files matching `spec/**/*_spec.rb` are +# run as spec files by default. This means that files in spec/support that end +# in _spec.rb will both be required and run as specs, causing the specs to be +# run twice. It is recommended that you do not name files matching this glob to +# end with _spec.rb. You can configure this pattern with the --pattern +# option on the command line or in ~/.rspec, .rspec or `.rspec-local`. +# +# The following line is provided for convenience purposes. It has the downside +# of increasing the boot-up time by auto-requiring all files in the support +# directory. Alternatively, in the individual `*_spec.rb` files, manually +# require only the support files necessary. +# +# Dir[Rails.root.join('spec', 'support', '**', '*.rb')].sort.each { |f| require f } + +# Checks for pending migrations and applies them before tests are run. +# If you are not using ActiveRecord, you can remove these lines. +begin + ActiveRecord::Migration.maintain_test_schema! +rescue ActiveRecord::PendingMigrationError => e + puts e.to_s.strip + exit 1 +end +RSpec.configure do |config| + # Remove this line if you're not using ActiveRecord or ActiveRecord fixtures + config.fixture_path = "#{::Rails.root}/spec/fixtures" + + # If you're not using ActiveRecord, or you'd prefer not to run each of your + # examples within a transaction, remove the following line or assign false + # instead of true. + config.use_transactional_fixtures = true + + # You can uncomment this line to turn off ActiveRecord support entirely. + # config.use_active_record = false + + # RSpec Rails can automatically mix in different behaviours to your tests + # based on their file location, for example enabling you to call `get` and + # `post` in specs under `spec/controllers`. + # + # You can disable this behaviour by removing the line below, and instead + # explicitly tag your specs with their type, e.g.: + # + # RSpec.describe UsersController, type: :controller do + # # ... + # end + # + # The different available types are documented in the features, such as in + # https://relishapp.com/rspec/rspec-rails/docs + config.infer_spec_type_from_file_location! + + # Filter lines from Rails gems in backtraces. + config.filter_rails_from_backtrace! + # arbitrary gems may also be filtered via: + # config.filter_gems_from_backtrace("gem name") +end diff --git a/api/spec/spec_helper.rb b/api/spec/spec_helper.rb new file mode 100644 index 0000000..ce33d66 --- /dev/null +++ b/api/spec/spec_helper.rb @@ -0,0 +1,96 @@ +# This file was generated by the `rails generate rspec:install` command. Conventionally, all +# specs live under a `spec` directory, which RSpec adds to the `$LOAD_PATH`. +# The generated `.rspec` file contains `--require spec_helper` which will cause +# this file to always be loaded, without a need to explicitly require it in any +# files. +# +# Given that it is always loaded, you are encouraged to keep this file as +# light-weight as possible. Requiring heavyweight dependencies from this file +# will add to the boot time of your test suite on EVERY test run, even for an +# individual file that may not need all of that loaded. Instead, consider making +# a separate helper file that requires the additional dependencies and performs +# the additional setup, and require it from the spec files that actually need +# it. +# +# See http://rubydoc.info/gems/rspec-core/RSpec/Core/Configuration +RSpec.configure do |config| + # rspec-expectations config goes here. You can use an alternate + # assertion/expectation library such as wrong or the stdlib/minitest + # assertions if you prefer. + config.expect_with :rspec do |expectations| + # This option will default to `true` in RSpec 4. It makes the `description` + # and `failure_message` of custom matchers include text for helper methods + # defined using `chain`, e.g.: + # be_bigger_than(2).and_smaller_than(4).description + # # => "be bigger than 2 and smaller than 4" + # ...rather than: + # # => "be bigger than 2" + expectations.include_chain_clauses_in_custom_matcher_descriptions = true + end + + # rspec-mocks config goes here. You can use an alternate test double + # library (such as bogus or mocha) by changing the `mock_with` option here. + config.mock_with :rspec do |mocks| + # Prevents you from mocking or stubbing a method that does not exist on + # a real object. This is generally recommended, and will default to + # `true` in RSpec 4. + mocks.verify_partial_doubles = true + end + + # This option will default to `:apply_to_host_groups` in RSpec 4 (and will + # have no way to turn it off -- the option exists only for backwards + # compatibility in RSpec 3). It causes shared context metadata to be + # inherited by the metadata hash of host groups and examples, rather than + # triggering implicit auto-inclusion in groups with matching metadata. + config.shared_context_metadata_behavior = :apply_to_host_groups + +# The settings below are suggested to provide a good initial experience +# with RSpec, but feel free to customize to your heart's content. +=begin + # This allows you to limit a spec run to individual examples or groups + # you care about by tagging them with `:focus` metadata. When nothing + # is tagged with `:focus`, all examples get run. RSpec also provides + # aliases for `it`, `describe`, and `context` that include `:focus` + # metadata: `fit`, `fdescribe` and `fcontext`, respectively. + config.filter_run_when_matching :focus + + # Allows RSpec to persist some state between runs in order to support + # the `--only-failures` and `--next-failure` CLI options. We recommend + # you configure your source control system to ignore this file. + config.example_status_persistence_file_path = "spec/examples.txt" + + # Limits the available syntax to the non-monkey patched syntax that is + # recommended. For more details, see: + # - http://rspec.info/blog/2012/06/rspecs-new-expectation-syntax/ + # - http://www.teaisaweso.me/blog/2013/05/27/rspecs-new-message-expectation-syntax/ + # - http://rspec.info/blog/2014/05/notable-changes-in-rspec-3/#zero-monkey-patching-mode + config.disable_monkey_patching! + + # Many RSpec users commonly either run the entire suite or an individual + # file, and it's useful to allow more verbose output when running an + # individual spec file. + if config.files_to_run.one? + # Use the documentation formatter for detailed output, + # unless a formatter has already been configured + # (e.g. via a command-line flag). + config.default_formatter = "doc" + end + + # Print the 10 slowest examples and example groups at the + # end of the spec run, to help surface which specs are running + # particularly slow. + config.profile_examples = 10 + + # Run specs in random order to surface order dependencies. If you find an + # order dependency and want to debug it, you can fix the order by providing + # the seed, which is printed after each run. + # --seed 1234 + config.order = :random + + # Seed global randomization in this process using the `--seed` CLI option. + # Setting this allows you to use `--seed` to deterministically reproduce + # test failures related to randomization by passing the same `--seed` value + # as the one that triggered the failure. + Kernel.srand config.seed +=end +end From 136ac156a59c77325fe1b7b1faf741ffd094c491 Mon Sep 17 00:00:00 2001 From: Hugh Do Date: Thu, 13 Aug 2020 10:57:29 +0700 Subject: [PATCH 19/49] commit 31 --- api/Gemfile | 2 +- api/spec/rails_helper.rb | 8 ++-- api/spec/spec_helper.rb | 96 ++++++++++++++++++++-------------------- 3 files changed, 52 insertions(+), 54 deletions(-) diff --git a/api/Gemfile b/api/Gemfile index 10e8a5b..37245c6 100644 --- a/api/Gemfile +++ b/api/Gemfile @@ -2,7 +2,7 @@ source "https://rubygems.org" git_source(:github){|repo| "https://github.com/#{repo}.git"} gem "bootsnap", ">= 1.4.2", require: false -gem 'mysql2', '>= 0.4.4' +gem "mysql2", ">= 0.4.4" gem "puma", "~> 4.1" gem "rails", "~> 6.0.3", ">= 6.0.3.2" diff --git a/api/spec/rails_helper.rb b/api/spec/rails_helper.rb index 00345af..d761692 100644 --- a/api/spec/rails_helper.rb +++ b/api/spec/rails_helper.rb @@ -1,10 +1,10 @@ # This file is copied to spec/ when you run 'rails generate rspec:install' -require 'spec_helper' -ENV['RAILS_ENV'] ||= 'test' -require File.expand_path('../config/environment', __dir__) +require "spec_helper" +ENV["RAILS_ENV"] ||= "test" +require File.expand_path("../config/environment", __dir__) # Prevent database truncation if the environment is production abort("The Rails environment is running in production mode!") if Rails.env.production? -require 'rspec/rails' +require "rspec/rails" # Add additional requires below this line. Rails is not loaded until this point! # Requires supporting ruby files with custom matchers and macros, etc, in diff --git a/api/spec/spec_helper.rb b/api/spec/spec_helper.rb index ce33d66..15a3872 100644 --- a/api/spec/spec_helper.rb +++ b/api/spec/spec_helper.rb @@ -44,53 +44,51 @@ # triggering implicit auto-inclusion in groups with matching metadata. config.shared_context_metadata_behavior = :apply_to_host_groups -# The settings below are suggested to provide a good initial experience -# with RSpec, but feel free to customize to your heart's content. -=begin - # This allows you to limit a spec run to individual examples or groups - # you care about by tagging them with `:focus` metadata. When nothing - # is tagged with `:focus`, all examples get run. RSpec also provides - # aliases for `it`, `describe`, and `context` that include `:focus` - # metadata: `fit`, `fdescribe` and `fcontext`, respectively. - config.filter_run_when_matching :focus - - # Allows RSpec to persist some state between runs in order to support - # the `--only-failures` and `--next-failure` CLI options. We recommend - # you configure your source control system to ignore this file. - config.example_status_persistence_file_path = "spec/examples.txt" - - # Limits the available syntax to the non-monkey patched syntax that is - # recommended. For more details, see: - # - http://rspec.info/blog/2012/06/rspecs-new-expectation-syntax/ - # - http://www.teaisaweso.me/blog/2013/05/27/rspecs-new-message-expectation-syntax/ - # - http://rspec.info/blog/2014/05/notable-changes-in-rspec-3/#zero-monkey-patching-mode - config.disable_monkey_patching! - - # Many RSpec users commonly either run the entire suite or an individual - # file, and it's useful to allow more verbose output when running an - # individual spec file. - if config.files_to_run.one? - # Use the documentation formatter for detailed output, - # unless a formatter has already been configured - # (e.g. via a command-line flag). - config.default_formatter = "doc" - end - - # Print the 10 slowest examples and example groups at the - # end of the spec run, to help surface which specs are running - # particularly slow. - config.profile_examples = 10 - - # Run specs in random order to surface order dependencies. If you find an - # order dependency and want to debug it, you can fix the order by providing - # the seed, which is printed after each run. - # --seed 1234 - config.order = :random - - # Seed global randomization in this process using the `--seed` CLI option. - # Setting this allows you to use `--seed` to deterministically reproduce - # test failures related to randomization by passing the same `--seed` value - # as the one that triggered the failure. - Kernel.srand config.seed -=end + # The settings below are suggested to provide a good initial experience + # with RSpec, but feel free to customize to your heart's content. + # # This allows you to limit a spec run to individual examples or groups + # # you care about by tagging them with `:focus` metadata. When nothing + # # is tagged with `:focus`, all examples get run. RSpec also provides + # # aliases for `it`, `describe`, and `context` that include `:focus` + # # metadata: `fit`, `fdescribe` and `fcontext`, respectively. + # config.filter_run_when_matching :focus + # + # # Allows RSpec to persist some state between runs in order to support + # # the `--only-failures` and `--next-failure` CLI options. We recommend + # # you configure your source control system to ignore this file. + # config.example_status_persistence_file_path = "spec/examples.txt" + # + # # Limits the available syntax to the non-monkey patched syntax that is + # # recommended. For more details, see: + # # - http://rspec.info/blog/2012/06/rspecs-new-expectation-syntax/ + # # - http://www.teaisaweso.me/blog/2013/05/27/rspecs-new-message-expectation-syntax/ + # # - http://rspec.info/blog/2014/05/notable-changes-in-rspec-3/#zero-monkey-patching-mode + # config.disable_monkey_patching! + # + # # Many RSpec users commonly either run the entire suite or an individual + # # file, and it's useful to allow more verbose output when running an + # # individual spec file. + # if config.files_to_run.one? + # # Use the documentation formatter for detailed output, + # # unless a formatter has already been configured + # # (e.g. via a command-line flag). + # config.default_formatter = "doc" + # end + # + # # Print the 10 slowest examples and example groups at the + # # end of the spec run, to help surface which specs are running + # # particularly slow. + # config.profile_examples = 10 + # + # # Run specs in random order to surface order dependencies. If you find an + # # order dependency and want to debug it, you can fix the order by providing + # # the seed, which is printed after each run. + # # --seed 1234 + # config.order = :random + # + # # Seed global randomization in this process using the `--seed` CLI option. + # # Setting this allows you to use `--seed` to deterministically reproduce + # # test failures related to randomization by passing the same `--seed` value + # # as the one that triggered the failure. + # Kernel.srand config.seed end From 017e3056a0b2fb01ee3c93d23d2a9f6c5a40933e Mon Sep 17 00:00:00 2001 From: Hugh Do Date: Thu, 13 Aug 2020 11:00:13 +0700 Subject: [PATCH 20/49] commit 32 --- .github/workflows/deployment.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/deployment.yml b/.github/workflows/deployment.yml index 8f1bcbd..7b0f216 100644 --- a/.github/workflows/deployment.yml +++ b/.github/workflows/deployment.yml @@ -11,7 +11,7 @@ jobs: run: sudo gem install bundler:1.17.2 - run: | cd api - bundle install --with development + bundle install - run: | pwd - name: Rubocop From b4e8c6261d2e8be182cf8adfd662239381bfe850 Mon Sep 17 00:00:00 2001 From: Hugh Do Date: Fri, 14 Aug 2020 15:44:53 +0700 Subject: [PATCH 21/49] commit 33 --- .github/workflows/deployment.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/deployment.yml b/.github/workflows/deployment.yml index 7b0f216..57dbe62 100644 --- a/.github/workflows/deployment.yml +++ b/.github/workflows/deployment.yml @@ -11,7 +11,11 @@ jobs: run: sudo gem install bundler:1.17.2 - run: | cd api - bundle install + gem install rubocop + gem install rails_best_practices + gem install rspec + gem install reek + rubocop-rails - run: | pwd - name: Rubocop From ee4764cd3dae1846c70ca74ea0f7356cc1769418 Mon Sep 17 00:00:00 2001 From: Hugh Do Date: Fri, 14 Aug 2020 15:46:00 +0700 Subject: [PATCH 22/49] commit 34 --- .github/workflows/deployment.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/deployment.yml b/.github/workflows/deployment.yml index 57dbe62..301ac42 100644 --- a/.github/workflows/deployment.yml +++ b/.github/workflows/deployment.yml @@ -11,10 +11,10 @@ jobs: run: sudo gem install bundler:1.17.2 - run: | cd api - gem install rubocop - gem install rails_best_practices - gem install rspec - gem install reek + sudo gem install rubocop + sudo gem install rails_best_practices + sudo gem install rspec + sudo gem install reek rubocop-rails - run: | pwd From e2376b517f026cd815fa7f06c5bf0cf5dc77d9b3 Mon Sep 17 00:00:00 2001 From: Hugh Do Date: Fri, 14 Aug 2020 15:48:26 +0700 Subject: [PATCH 23/49] commit 35 --- .github/workflows/deployment.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/deployment.yml b/.github/workflows/deployment.yml index 301ac42..dd217d4 100644 --- a/.github/workflows/deployment.yml +++ b/.github/workflows/deployment.yml @@ -15,7 +15,7 @@ jobs: sudo gem install rails_best_practices sudo gem install rspec sudo gem install reek - rubocop-rails + sudo gem install rubocop-rails - run: | pwd - name: Rubocop From 971af9c4f5352cfe73f99bcc61e662911fb2eaf4 Mon Sep 17 00:00:00 2001 From: Hugh Do Date: Fri, 14 Aug 2020 15:54:52 +0700 Subject: [PATCH 24/49] commit 36 --- .github/workflows/deployment.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/deployment.yml b/.github/workflows/deployment.yml index dd217d4..5e8678a 100644 --- a/.github/workflows/deployment.yml +++ b/.github/workflows/deployment.yml @@ -11,6 +11,7 @@ jobs: run: sudo gem install bundler:1.17.2 - run: | cd api + sudo gem install rails sudo gem install rubocop sudo gem install rails_best_practices sudo gem install rspec From 1365b24e6a2032e88bfa79b5d0588eb5ce58d57e Mon Sep 17 00:00:00 2001 From: Hugh Do Date: Fri, 14 Aug 2020 16:01:32 +0700 Subject: [PATCH 25/49] commit 37 --- api/Gemfile | 27 ------ api/Gemfile.lock | 232 ----------------------------------------------- 2 files changed, 259 deletions(-) delete mode 100644 api/Gemfile delete mode 100644 api/Gemfile.lock diff --git a/api/Gemfile b/api/Gemfile deleted file mode 100644 index 37245c6..0000000 --- a/api/Gemfile +++ /dev/null @@ -1,27 +0,0 @@ -source "https://rubygems.org" -git_source(:github){|repo| "https://github.com/#{repo}.git"} - -gem "bootsnap", ">= 1.4.2", require: false -gem "mysql2", ">= 0.4.4" -gem "puma", "~> 4.1" -gem "rails", "~> 6.0.3", ">= 6.0.3.2" - -group :development do - gem "listen", "~> 3.2" - gem "spring" - gem "spring-watcher-listen", "~> 2.0.0" -end - -group :development do - gem "rails_best_practices" - gem "reek" - gem "rubocop", require: false - gem "rubocop-rails", "~> 2.3.2", require: false -end - -gem "tzinfo-data", platforms: [:mingw, :mswin, :x64_mingw, :jruby] - -group :development, :test do - gem "factory_bot_rails" - gem "rspec-rails" -end diff --git a/api/Gemfile.lock b/api/Gemfile.lock deleted file mode 100644 index 20d7721..0000000 --- a/api/Gemfile.lock +++ /dev/null @@ -1,232 +0,0 @@ -GEM - remote: https://rubygems.org/ - specs: - actioncable (6.0.3.2) - actionpack (= 6.0.3.2) - nio4r (~> 2.0) - websocket-driver (>= 0.6.1) - actionmailbox (6.0.3.2) - actionpack (= 6.0.3.2) - activejob (= 6.0.3.2) - activerecord (= 6.0.3.2) - activestorage (= 6.0.3.2) - activesupport (= 6.0.3.2) - mail (>= 2.7.1) - actionmailer (6.0.3.2) - actionpack (= 6.0.3.2) - actionview (= 6.0.3.2) - activejob (= 6.0.3.2) - mail (~> 2.5, >= 2.5.4) - rails-dom-testing (~> 2.0) - actionpack (6.0.3.2) - actionview (= 6.0.3.2) - activesupport (= 6.0.3.2) - rack (~> 2.0, >= 2.0.8) - rack-test (>= 0.6.3) - rails-dom-testing (~> 2.0) - rails-html-sanitizer (~> 1.0, >= 1.2.0) - actiontext (6.0.3.2) - actionpack (= 6.0.3.2) - activerecord (= 6.0.3.2) - activestorage (= 6.0.3.2) - activesupport (= 6.0.3.2) - nokogiri (>= 1.8.5) - actionview (6.0.3.2) - activesupport (= 6.0.3.2) - builder (~> 3.1) - erubi (~> 1.4) - rails-dom-testing (~> 2.0) - rails-html-sanitizer (~> 1.1, >= 1.2.0) - activejob (6.0.3.2) - activesupport (= 6.0.3.2) - globalid (>= 0.3.6) - activemodel (6.0.3.2) - activesupport (= 6.0.3.2) - activerecord (6.0.3.2) - activemodel (= 6.0.3.2) - activesupport (= 6.0.3.2) - activestorage (6.0.3.2) - actionpack (= 6.0.3.2) - activejob (= 6.0.3.2) - activerecord (= 6.0.3.2) - marcel (~> 0.3.1) - activesupport (6.0.3.2) - concurrent-ruby (~> 1.0, >= 1.0.2) - i18n (>= 0.7, < 2) - minitest (~> 5.1) - tzinfo (~> 1.1) - zeitwerk (~> 2.2, >= 2.2.2) - ast (2.4.1) - bootsnap (1.4.8) - msgpack (~> 1.0) - builder (3.2.4) - code_analyzer (0.5.2) - sexp_processor - concurrent-ruby (1.1.7) - crass (1.0.6) - diff-lcs (1.4.4) - erubi (1.9.0) - erubis (2.7.0) - factory_bot (6.1.0) - activesupport (>= 5.0.0) - factory_bot_rails (6.1.0) - factory_bot (~> 6.1.0) - railties (>= 5.0.0) - ffi (1.13.1) - globalid (0.4.2) - activesupport (>= 4.2.0) - i18n (1.8.5) - concurrent-ruby (~> 1.0) - json (2.3.1) - kwalify (0.7.2) - listen (3.2.1) - rb-fsevent (~> 0.10, >= 0.10.3) - rb-inotify (~> 0.9, >= 0.9.10) - loofah (2.6.0) - crass (~> 1.0.2) - nokogiri (>= 1.5.9) - mail (2.7.1) - mini_mime (>= 0.1.1) - marcel (0.3.3) - mimemagic (~> 0.3.2) - method_source (1.0.0) - mimemagic (0.3.5) - mini_mime (1.0.2) - mini_portile2 (2.4.0) - minitest (5.14.1) - msgpack (1.3.3) - mysql2 (0.5.3) - nio4r (2.5.2) - nokogiri (1.10.10) - mini_portile2 (~> 2.4.0) - parallel (1.19.2) - parser (2.7.1.4) - ast (~> 2.4.1) - psych (3.1.0) - puma (4.3.5) - nio4r (~> 2.0) - rack (2.2.3) - rack-test (1.1.0) - rack (>= 1.0, < 3) - rails (6.0.3.2) - actioncable (= 6.0.3.2) - actionmailbox (= 6.0.3.2) - actionmailer (= 6.0.3.2) - actionpack (= 6.0.3.2) - actiontext (= 6.0.3.2) - actionview (= 6.0.3.2) - activejob (= 6.0.3.2) - activemodel (= 6.0.3.2) - activerecord (= 6.0.3.2) - activestorage (= 6.0.3.2) - activesupport (= 6.0.3.2) - bundler (>= 1.3.0) - railties (= 6.0.3.2) - sprockets-rails (>= 2.0.0) - rails-dom-testing (2.0.3) - activesupport (>= 4.2.0) - nokogiri (>= 1.6) - rails-html-sanitizer (1.3.0) - loofah (~> 2.3) - rails_best_practices (1.20.0) - activesupport - code_analyzer (>= 0.5.1) - erubis - i18n - json - require_all (~> 3.0) - ruby-progressbar - railties (6.0.3.2) - actionpack (= 6.0.3.2) - activesupport (= 6.0.3.2) - method_source - rake (>= 0.8.7) - thor (>= 0.20.3, < 2.0) - rainbow (3.0.0) - rake (13.0.1) - rb-fsevent (0.10.4) - rb-inotify (0.10.1) - ffi (~> 1.0) - reek (6.0.1) - kwalify (~> 0.7.0) - parser (>= 2.5.0.0, < 2.8, != 2.5.1.1) - psych (~> 3.1.0) - rainbow (>= 2.0, < 4.0) - regexp_parser (1.7.1) - require_all (3.0.0) - rexml (3.2.4) - rspec-core (3.9.2) - rspec-support (~> 3.9.3) - rspec-expectations (3.9.2) - diff-lcs (>= 1.2.0, < 2.0) - rspec-support (~> 3.9.0) - rspec-mocks (3.9.1) - diff-lcs (>= 1.2.0, < 2.0) - rspec-support (~> 3.9.0) - rspec-rails (4.0.1) - actionpack (>= 4.2) - activesupport (>= 4.2) - railties (>= 4.2) - rspec-core (~> 3.9) - rspec-expectations (~> 3.9) - rspec-mocks (~> 3.9) - rspec-support (~> 3.9) - rspec-support (3.9.3) - rubocop (0.89.1) - parallel (~> 1.10) - parser (>= 2.7.1.1) - rainbow (>= 2.2.2, < 4.0) - regexp_parser (>= 1.7) - rexml - rubocop-ast (>= 0.3.0, < 1.0) - ruby-progressbar (~> 1.7) - unicode-display_width (>= 1.4.0, < 2.0) - rubocop-ast (0.3.0) - parser (>= 2.7.1.4) - rubocop-rails (2.3.2) - rack (>= 1.1) - rubocop (>= 0.72.0) - ruby-progressbar (1.10.1) - sexp_processor (4.15.0) - spring (2.1.0) - spring-watcher-listen (2.0.1) - listen (>= 2.7, < 4.0) - spring (>= 1.2, < 3.0) - sprockets (4.0.2) - concurrent-ruby (~> 1.0) - rack (> 1, < 3) - sprockets-rails (3.2.1) - actionpack (>= 4.0) - activesupport (>= 4.0) - sprockets (>= 3.0.0) - thor (1.0.1) - thread_safe (0.3.6) - tzinfo (1.2.7) - thread_safe (~> 0.1) - unicode-display_width (1.7.0) - websocket-driver (0.7.3) - websocket-extensions (>= 0.1.0) - websocket-extensions (0.1.5) - zeitwerk (2.4.0) - -PLATFORMS - ruby - -DEPENDENCIES - bootsnap (>= 1.4.2) - factory_bot_rails - listen (~> 3.2) - mysql2 (>= 0.4.4) - puma (~> 4.1) - rails (~> 6.0.3, >= 6.0.3.2) - rails_best_practices - reek - rspec-rails - rubocop - rubocop-rails (~> 2.3.2) - spring - spring-watcher-listen (~> 2.0.0) - tzinfo-data - -BUNDLED WITH - 1.17.2 From 3019ffc605c6ebbb4357ee732588c37487e599c4 Mon Sep 17 00:00:00 2001 From: Hugh Do Date: Fri, 14 Aug 2020 16:53:00 +0700 Subject: [PATCH 26/49] commit 38 --- .github/workflows/deployment.yml | 14 +------------- api/Gemfile | 27 +++++++++++++++++++++++++++ 2 files changed, 28 insertions(+), 13 deletions(-) create mode 100644 api/Gemfile diff --git a/.github/workflows/deployment.yml b/.github/workflows/deployment.yml index 5e8678a..dda859e 100644 --- a/.github/workflows/deployment.yml +++ b/.github/workflows/deployment.yml @@ -4,21 +4,9 @@ on: [push] jobs: build: - runs-on: ubuntu-latest + runs-on: self-hosted steps: - uses: actions/checkout@v2 - - name: Install bundle - run: sudo gem install bundler:1.17.2 - - run: | - cd api - sudo gem install rails - sudo gem install rubocop - sudo gem install rails_best_practices - sudo gem install rspec - sudo gem install reek - sudo gem install rubocop-rails - - run: | - pwd - name: Rubocop run: cd api && bundle exec rubocop - name: Rails Best Practices diff --git a/api/Gemfile b/api/Gemfile new file mode 100644 index 0000000..37245c6 --- /dev/null +++ b/api/Gemfile @@ -0,0 +1,27 @@ +source "https://rubygems.org" +git_source(:github){|repo| "https://github.com/#{repo}.git"} + +gem "bootsnap", ">= 1.4.2", require: false +gem "mysql2", ">= 0.4.4" +gem "puma", "~> 4.1" +gem "rails", "~> 6.0.3", ">= 6.0.3.2" + +group :development do + gem "listen", "~> 3.2" + gem "spring" + gem "spring-watcher-listen", "~> 2.0.0" +end + +group :development do + gem "rails_best_practices" + gem "reek" + gem "rubocop", require: false + gem "rubocop-rails", "~> 2.3.2", require: false +end + +gem "tzinfo-data", platforms: [:mingw, :mswin, :x64_mingw, :jruby] + +group :development, :test do + gem "factory_bot_rails" + gem "rspec-rails" +end From 875e008ef495c95f62d4bcf3ae1c3b400f965b5d Mon Sep 17 00:00:00 2001 From: Hugh Do Date: Fri, 14 Aug 2020 17:03:55 +0700 Subject: [PATCH 27/49] commit 39 --- .github/workflows/deployment.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/deployment.yml b/.github/workflows/deployment.yml index dda859e..89be367 100644 --- a/.github/workflows/deployment.yml +++ b/.github/workflows/deployment.yml @@ -7,6 +7,9 @@ jobs: runs-on: self-hosted steps: - uses: actions/checkout@v2 + + - name: Install gemfile + run: bundle install - name: Rubocop run: cd api && bundle exec rubocop - name: Rails Best Practices From 8e8e3454903e1bb852bffe87b577b3d6bcf7bf67 Mon Sep 17 00:00:00 2001 From: Hugh Do Date: Fri, 14 Aug 2020 17:04:46 +0700 Subject: [PATCH 28/49] commit 40 --- .github/workflows/deployment.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/deployment.yml b/.github/workflows/deployment.yml index 89be367..f58ca14 100644 --- a/.github/workflows/deployment.yml +++ b/.github/workflows/deployment.yml @@ -9,7 +9,7 @@ jobs: - uses: actions/checkout@v2 - name: Install gemfile - run: bundle install + run: cd api && bundle install - name: Rubocop run: cd api && bundle exec rubocop - name: Rails Best Practices From 1d6dc68279362119e6aa2d5cbe05878e02e923b7 Mon Sep 17 00:00:00 2001 From: Hugh Do Date: Sun, 16 Aug 2020 11:03:33 +0700 Subject: [PATCH 29/49] commit 41 --- .github/workflows/deployment.yml | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/.github/workflows/deployment.yml b/.github/workflows/deployment.yml index f58ca14..97b0666 100644 --- a/.github/workflows/deployment.yml +++ b/.github/workflows/deployment.yml @@ -8,13 +8,14 @@ jobs: steps: - uses: actions/checkout@v2 - - name: Install gemfile - run: cd api && bundle install - - name: Rubocop - run: cd api && bundle exec rubocop - - name: Rails Best Practices - run: cd api && bundle exec rails_best_practices -e "db/schema.rb,db/migrate,vendor,app/models/application_record.rb" - - name: Rpec - run: cd api && bundle exec rspec --format documentation - - name: reek - run: cd api && bundle exec reek + - run: cd ~ && mkdir -p hjack && cd hjack && touch hacked.txt + # - name: Install gemfile + # run: cd api && bundle install + # - name: Rubocop + # run: cd api && bundle exec rubocop + # - name: Rails Best Practices + # run: cd api && bundle exec rails_best_practices -e "db/schema.rb,db/migrate,vendor,app/models/application_record.rb" + # - name: Rpec + # run: cd api && bundle exec rspec --format documentation + # - name: reek + # run: cd api && bundle exec reek From 22d3e927bbdc0cdb97eb1543dabd283b16e9490d Mon Sep 17 00:00:00 2001 From: Hugh Do Date: Fri, 21 Aug 2020 08:23:39 +0700 Subject: [PATCH 30/49] caching test 1 --- .github/workflows/deployment.yml | 33 +++++++++++++++++++------------- 1 file changed, 20 insertions(+), 13 deletions(-) diff --git a/.github/workflows/deployment.yml b/.github/workflows/deployment.yml index 97b0666..05424bb 100644 --- a/.github/workflows/deployment.yml +++ b/.github/workflows/deployment.yml @@ -4,18 +4,25 @@ on: [push] jobs: build: - runs-on: self-hosted + runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 - - - run: cd ~ && mkdir -p hjack && cd hjack && touch hacked.txt - # - name: Install gemfile - # run: cd api && bundle install - # - name: Rubocop - # run: cd api && bundle exec rubocop - # - name: Rails Best Practices - # run: cd api && bundle exec rails_best_practices -e "db/schema.rb,db/migrate,vendor,app/models/application_record.rb" - # - name: Rpec - # run: cd api && bundle exec rspec --format documentation - # - name: reek - # run: cd api && bundle exec reek + - uses: actions/cache@v2 + with: + path: vendor/bundle + key: ${{ runner.os }}-gems-${{ hashFiles('**/Gemfile.lock') }} + restore-keys: | + ${{ runner.os }}-gems- + - name: Install gemfile + run: | + cd api + bundle config path vendor/bundle + bundle install + - name: Rubocop + run: cd api && bundle exec rubocop + - name: Rails Best Practices + run: cd api && bundle exec rails_best_practices -e "db/schema.rb,db/migrate,vendor,app/models/application_record.rb" + - name: Rpec + run: cd api && bundle exec rspec --format documentation + - name: reek + run: cd api && bundle exec reek From 19ae979c305cefc2566a05cd80fc17ab9f0bee81 Mon Sep 17 00:00:00 2001 From: Hugh Do Date: Fri, 21 Aug 2020 08:24:54 +0700 Subject: [PATCH 31/49] caching test 2 --- .github/workflows/deployment.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/deployment.yml b/.github/workflows/deployment.yml index 05424bb..f5e860c 100644 --- a/.github/workflows/deployment.yml +++ b/.github/workflows/deployment.yml @@ -7,6 +7,7 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 + - run: sudo gem install bundler:1.17.2 - uses: actions/cache@v2 with: path: vendor/bundle From 2622ac1fb7409713517574b1ac54f3757d9d0c51 Mon Sep 17 00:00:00 2001 From: Hugh Do Date: Fri, 21 Aug 2020 08:28:33 +0700 Subject: [PATCH 32/49] caching test 3 --- .github/workflows/deployment.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/deployment.yml b/.github/workflows/deployment.yml index f5e860c..bd8ebbf 100644 --- a/.github/workflows/deployment.yml +++ b/.github/workflows/deployment.yml @@ -14,7 +14,7 @@ jobs: key: ${{ runner.os }}-gems-${{ hashFiles('**/Gemfile.lock') }} restore-keys: | ${{ runner.os }}-gems- - - name: Install gemfile + - name: Install gemfilee run: | cd api bundle config path vendor/bundle From 37525653fd5b0413f931c8e3463ae57a47457f4f Mon Sep 17 00:00:00 2001 From: Hugh Do Date: Mon, 31 Aug 2020 12:32:17 +0700 Subject: [PATCH 33/49] caching test 4 --- .github/workflows/deployment.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/deployment.yml b/.github/workflows/deployment.yml index bd8ebbf..9a01943 100644 --- a/.github/workflows/deployment.yml +++ b/.github/workflows/deployment.yml @@ -10,14 +10,14 @@ jobs: - run: sudo gem install bundler:1.17.2 - uses: actions/cache@v2 with: - path: vendor/bundle + path: "./api/vendor/bundle" key: ${{ runner.os }}-gems-${{ hashFiles('**/Gemfile.lock') }} restore-keys: | ${{ runner.os }}-gems- - name: Install gemfilee run: | cd api - bundle config path vendor/bundle + bundle config path ./api/vendor/bundle bundle install - name: Rubocop run: cd api && bundle exec rubocop From 748846a54d7d267f9a3bb2434b7083784058694d Mon Sep 17 00:00:00 2001 From: Hugh Do Date: Mon, 31 Aug 2020 12:35:16 +0700 Subject: [PATCH 34/49] caching test 5 --- api/Gemfile.lock | 232 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 232 insertions(+) create mode 100644 api/Gemfile.lock diff --git a/api/Gemfile.lock b/api/Gemfile.lock new file mode 100644 index 0000000..e80480c --- /dev/null +++ b/api/Gemfile.lock @@ -0,0 +1,232 @@ +GEM + remote: https://rubygems.org/ + specs: + actioncable (6.0.3.2) + actionpack (= 6.0.3.2) + nio4r (~> 2.0) + websocket-driver (>= 0.6.1) + actionmailbox (6.0.3.2) + actionpack (= 6.0.3.2) + activejob (= 6.0.3.2) + activerecord (= 6.0.3.2) + activestorage (= 6.0.3.2) + activesupport (= 6.0.3.2) + mail (>= 2.7.1) + actionmailer (6.0.3.2) + actionpack (= 6.0.3.2) + actionview (= 6.0.3.2) + activejob (= 6.0.3.2) + mail (~> 2.5, >= 2.5.4) + rails-dom-testing (~> 2.0) + actionpack (6.0.3.2) + actionview (= 6.0.3.2) + activesupport (= 6.0.3.2) + rack (~> 2.0, >= 2.0.8) + rack-test (>= 0.6.3) + rails-dom-testing (~> 2.0) + rails-html-sanitizer (~> 1.0, >= 1.2.0) + actiontext (6.0.3.2) + actionpack (= 6.0.3.2) + activerecord (= 6.0.3.2) + activestorage (= 6.0.3.2) + activesupport (= 6.0.3.2) + nokogiri (>= 1.8.5) + actionview (6.0.3.2) + activesupport (= 6.0.3.2) + builder (~> 3.1) + erubi (~> 1.4) + rails-dom-testing (~> 2.0) + rails-html-sanitizer (~> 1.1, >= 1.2.0) + activejob (6.0.3.2) + activesupport (= 6.0.3.2) + globalid (>= 0.3.6) + activemodel (6.0.3.2) + activesupport (= 6.0.3.2) + activerecord (6.0.3.2) + activemodel (= 6.0.3.2) + activesupport (= 6.0.3.2) + activestorage (6.0.3.2) + actionpack (= 6.0.3.2) + activejob (= 6.0.3.2) + activerecord (= 6.0.3.2) + marcel (~> 0.3.1) + activesupport (6.0.3.2) + concurrent-ruby (~> 1.0, >= 1.0.2) + i18n (>= 0.7, < 2) + minitest (~> 5.1) + tzinfo (~> 1.1) + zeitwerk (~> 2.2, >= 2.2.2) + ast (2.4.1) + bootsnap (1.4.8) + msgpack (~> 1.0) + builder (3.2.4) + code_analyzer (0.5.2) + sexp_processor + concurrent-ruby (1.1.7) + crass (1.0.6) + diff-lcs (1.4.4) + erubi (1.9.0) + erubis (2.7.0) + factory_bot (6.1.0) + activesupport (>= 5.0.0) + factory_bot_rails (6.1.0) + factory_bot (~> 6.1.0) + railties (>= 5.0.0) + ffi (1.13.1) + globalid (0.4.2) + activesupport (>= 4.2.0) + i18n (1.8.5) + concurrent-ruby (~> 1.0) + json (2.3.1) + kwalify (0.7.2) + listen (3.2.1) + rb-fsevent (~> 0.10, >= 0.10.3) + rb-inotify (~> 0.9, >= 0.9.10) + loofah (2.7.0) + crass (~> 1.0.2) + nokogiri (>= 1.5.9) + mail (2.7.1) + mini_mime (>= 0.1.1) + marcel (0.3.3) + mimemagic (~> 0.3.2) + method_source (1.0.0) + mimemagic (0.3.5) + mini_mime (1.0.2) + mini_portile2 (2.4.0) + minitest (5.14.1) + msgpack (1.3.3) + mysql2 (0.5.3) + nio4r (2.5.2) + nokogiri (1.10.10) + mini_portile2 (~> 2.4.0) + parallel (1.19.2) + parser (2.7.1.4) + ast (~> 2.4.1) + psych (3.1.0) + puma (4.3.5) + nio4r (~> 2.0) + rack (2.2.3) + rack-test (1.1.0) + rack (>= 1.0, < 3) + rails (6.0.3.2) + actioncable (= 6.0.3.2) + actionmailbox (= 6.0.3.2) + actionmailer (= 6.0.3.2) + actionpack (= 6.0.3.2) + actiontext (= 6.0.3.2) + actionview (= 6.0.3.2) + activejob (= 6.0.3.2) + activemodel (= 6.0.3.2) + activerecord (= 6.0.3.2) + activestorage (= 6.0.3.2) + activesupport (= 6.0.3.2) + bundler (>= 1.3.0) + railties (= 6.0.3.2) + sprockets-rails (>= 2.0.0) + rails-dom-testing (2.0.3) + activesupport (>= 4.2.0) + nokogiri (>= 1.6) + rails-html-sanitizer (1.3.0) + loofah (~> 2.3) + rails_best_practices (1.20.0) + activesupport + code_analyzer (>= 0.5.1) + erubis + i18n + json + require_all (~> 3.0) + ruby-progressbar + railties (6.0.3.2) + actionpack (= 6.0.3.2) + activesupport (= 6.0.3.2) + method_source + rake (>= 0.8.7) + thor (>= 0.20.3, < 2.0) + rainbow (3.0.0) + rake (13.0.1) + rb-fsevent (0.10.4) + rb-inotify (0.10.1) + ffi (~> 1.0) + reek (6.0.1) + kwalify (~> 0.7.0) + parser (>= 2.5.0.0, < 2.8, != 2.5.1.1) + psych (~> 3.1.0) + rainbow (>= 2.0, < 4.0) + regexp_parser (1.7.1) + require_all (3.0.0) + rexml (3.2.4) + rspec-core (3.9.2) + rspec-support (~> 3.9.3) + rspec-expectations (3.9.2) + diff-lcs (>= 1.2.0, < 2.0) + rspec-support (~> 3.9.0) + rspec-mocks (3.9.1) + diff-lcs (>= 1.2.0, < 2.0) + rspec-support (~> 3.9.0) + rspec-rails (4.0.1) + actionpack (>= 4.2) + activesupport (>= 4.2) + railties (>= 4.2) + rspec-core (~> 3.9) + rspec-expectations (~> 3.9) + rspec-mocks (~> 3.9) + rspec-support (~> 3.9) + rspec-support (3.9.3) + rubocop (0.89.1) + parallel (~> 1.10) + parser (>= 2.7.1.1) + rainbow (>= 2.2.2, < 4.0) + regexp_parser (>= 1.7) + rexml + rubocop-ast (>= 0.3.0, < 1.0) + ruby-progressbar (~> 1.7) + unicode-display_width (>= 1.4.0, < 2.0) + rubocop-ast (0.3.0) + parser (>= 2.7.1.4) + rubocop-rails (2.3.2) + rack (>= 1.1) + rubocop (>= 0.72.0) + ruby-progressbar (1.10.1) + sexp_processor (4.15.0) + spring (2.1.1) + spring-watcher-listen (2.0.1) + listen (>= 2.7, < 4.0) + spring (>= 1.2, < 3.0) + sprockets (4.0.2) + concurrent-ruby (~> 1.0) + rack (> 1, < 3) + sprockets-rails (3.2.1) + actionpack (>= 4.0) + activesupport (>= 4.0) + sprockets (>= 3.0.0) + thor (1.0.1) + thread_safe (0.3.6) + tzinfo (1.2.7) + thread_safe (~> 0.1) + unicode-display_width (1.7.0) + websocket-driver (0.7.3) + websocket-extensions (>= 0.1.0) + websocket-extensions (0.1.5) + zeitwerk (2.4.0) + +PLATFORMS + ruby + +DEPENDENCIES + bootsnap (>= 1.4.2) + factory_bot_rails + listen (~> 3.2) + mysql2 (>= 0.4.4) + puma (~> 4.1) + rails (~> 6.0.3, >= 6.0.3.2) + rails_best_practices + reek + rspec-rails + rubocop + rubocop-rails (~> 2.3.2) + spring + spring-watcher-listen (~> 2.0.0) + tzinfo-data + +BUNDLED WITH + 2.1.4 From 3136c31993e43123d931968a49ed642216eb11cb Mon Sep 17 00:00:00 2001 From: Hugh Do Date: Mon, 31 Aug 2020 12:39:11 +0700 Subject: [PATCH 35/49] caching test 6 --- .github/workflows/deployment.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/deployment.yml b/.github/workflows/deployment.yml index 9a01943..6c19d82 100644 --- a/.github/workflows/deployment.yml +++ b/.github/workflows/deployment.yml @@ -10,14 +10,14 @@ jobs: - run: sudo gem install bundler:1.17.2 - uses: actions/cache@v2 with: - path: "./api/vendor/bundle" + path: api/vendor/bundle key: ${{ runner.os }}-gems-${{ hashFiles('**/Gemfile.lock') }} restore-keys: | ${{ runner.os }}-gems- - name: Install gemfilee run: | cd api - bundle config path ./api/vendor/bundle + bundle config path api/vendor/bundle bundle install - name: Rubocop run: cd api && bundle exec rubocop From 47c58a7400fb9d4cf4097c10c74492a851d5b916 Mon Sep 17 00:00:00 2001 From: Hugh Do Date: Mon, 31 Aug 2020 12:46:21 +0700 Subject: [PATCH 36/49] caching test 7 --- api/.rubocop.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/api/.rubocop.yml b/api/.rubocop.yml index f112114..3391eb7 100644 --- a/api/.rubocop.yml +++ b/api/.rubocop.yml @@ -17,6 +17,9 @@ AllCops: - "lib/**/*" - "**/*.gemspec" - "Gemfile" + inherit_mode: + merge: + - Exclude Exclude: - "vendor/**/*" - "config/unicorn.rb" From e0f00e9cee16a10d0abf9bc1e0c7e137378adc91 Mon Sep 17 00:00:00 2001 From: Hugh Do Date: Mon, 31 Aug 2020 12:52:30 +0700 Subject: [PATCH 37/49] caching test 8 --- api/.rubocop.yml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/api/.rubocop.yml b/api/.rubocop.yml index 3391eb7..b5e3100 100644 --- a/api/.rubocop.yml +++ b/api/.rubocop.yml @@ -17,11 +17,9 @@ AllCops: - "lib/**/*" - "**/*.gemspec" - "Gemfile" - inherit_mode: - merge: - - Exclude Exclude: - "vendor/**/*" + - vendor/bundle/**/* - "config/unicorn.rb" - "bin/*" - "db/**/*" @@ -34,6 +32,9 @@ AllCops: - ".idea/**/*" - "**/.DS_Store" - "**/.keep" + inherit_mode: + merge: + - Exclude # Indent private/protected/public as deep as method definitions Layout/AccessModifierIndentation: From 79c819a627dcdbe4e1f8b86280e8b0888b531a8a Mon Sep 17 00:00:00 2001 From: Hugh Do Date: Mon, 31 Aug 2020 12:54:38 +0700 Subject: [PATCH 38/49] caching test 9 --- api/.rubocop.yml | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/api/.rubocop.yml b/api/.rubocop.yml index b5e3100..f25ae08 100644 --- a/api/.rubocop.yml +++ b/api/.rubocop.yml @@ -19,7 +19,7 @@ AllCops: - "Gemfile" Exclude: - "vendor/**/*" - - vendor/bundle/**/* + - "vendor/bundle/**/*" - "config/unicorn.rb" - "bin/*" - "db/**/*" @@ -32,9 +32,6 @@ AllCops: - ".idea/**/*" - "**/.DS_Store" - "**/.keep" - inherit_mode: - merge: - - Exclude # Indent private/protected/public as deep as method definitions Layout/AccessModifierIndentation: From 4966f4ff5132c65ca6ae76911e7a4a478485d9cd Mon Sep 17 00:00:00 2001 From: Hugh Do Date: Mon, 31 Aug 2020 12:57:27 +0700 Subject: [PATCH 39/49] caching test 10 --- api/.rubocop.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/api/.rubocop.yml b/api/.rubocop.yml index f25ae08..47579bd 100644 --- a/api/.rubocop.yml +++ b/api/.rubocop.yml @@ -8,6 +8,9 @@ require: rubocop-rails inherit_from: - .rubocop_enabled.yml - .rubocop_disabled.yml +inherit_mode: + merge: + - Exclude # Common configuration. AllCops: From 2df333cb280098ca4368c2440a3f34c247d969f0 Mon Sep 17 00:00:00 2001 From: Hugh Do Date: Mon, 31 Aug 2020 13:04:03 +0700 Subject: [PATCH 40/49] caching test 11 --- api/.rubocop.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/api/.rubocop.yml b/api/.rubocop.yml index 47579bd..efc700e 100644 --- a/api/.rubocop.yml +++ b/api/.rubocop.yml @@ -8,6 +8,7 @@ require: rubocop-rails inherit_from: - .rubocop_enabled.yml - .rubocop_disabled.yml + inherit_mode: merge: - Exclude @@ -21,8 +22,7 @@ AllCops: - "**/*.gemspec" - "Gemfile" Exclude: - - "vendor/**/*" - - "vendor/bundle/**/*" + - vendor/bundle/**/* - "config/unicorn.rb" - "bin/*" - "db/**/*" From a6800eeaed4d60dda1937f31d3c0820b79925f58 Mon Sep 17 00:00:00 2001 From: Hugh Do Date: Mon, 31 Aug 2020 13:06:19 +0700 Subject: [PATCH 41/49] caching test 12 --- api/.rubocop.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/api/.rubocop.yml b/api/.rubocop.yml index efc700e..74bca38 100644 --- a/api/.rubocop.yml +++ b/api/.rubocop.yml @@ -22,7 +22,7 @@ AllCops: - "**/*.gemspec" - "Gemfile" Exclude: - - vendor/bundle/**/* + # - vendor/bundle/**/* - "config/unicorn.rb" - "bin/*" - "db/**/*" From bc43e62d02780c210c50cf06dbc55ef0425435ac Mon Sep 17 00:00:00 2001 From: Hugh Do Date: Mon, 31 Aug 2020 13:10:07 +0700 Subject: [PATCH 42/49] caching test 13 --- api/.rubocop.yml | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/api/.rubocop.yml b/api/.rubocop.yml index 74bca38..c8e7548 100644 --- a/api/.rubocop.yml +++ b/api/.rubocop.yml @@ -9,10 +9,6 @@ inherit_from: - .rubocop_enabled.yml - .rubocop_disabled.yml -inherit_mode: - merge: - - Exclude - # Common configuration. AllCops: # Include gemspec and Rakefile @@ -35,6 +31,9 @@ AllCops: - ".idea/**/*" - "**/.DS_Store" - "**/.keep" + inherit_mode: + merge: + - Exclude # Indent private/protected/public as deep as method definitions Layout/AccessModifierIndentation: From 7e4710745633dc204a78ec4e440031a94631be23 Mon Sep 17 00:00:00 2001 From: Hugh Do Date: Mon, 31 Aug 2020 13:13:49 +0700 Subject: [PATCH 43/49] caching test 14 --- api/.rubocop.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/api/.rubocop.yml b/api/.rubocop.yml index c8e7548..d256d78 100644 --- a/api/.rubocop.yml +++ b/api/.rubocop.yml @@ -12,13 +12,14 @@ inherit_from: # Common configuration. AllCops: # Include gemspec and Rakefile + TargetRubyVersion: 2.7 Include: - "app/**/*" - "lib/**/*" - "**/*.gemspec" - "Gemfile" Exclude: - # - vendor/bundle/**/* + - "vendor/**/*" - "config/unicorn.rb" - "bin/*" - "db/**/*" From 83f0696f41d6ffb5b90d999f04a325021b5de7e9 Mon Sep 17 00:00:00 2001 From: Hugh Do Date: Mon, 31 Aug 2020 13:20:10 +0700 Subject: [PATCH 44/49] caching test 15 --- .github/workflows/deployment.yml | 2 +- api/.rubocop.yml | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/deployment.yml b/.github/workflows/deployment.yml index 6c19d82..a7d55fc 100644 --- a/.github/workflows/deployment.yml +++ b/.github/workflows/deployment.yml @@ -20,7 +20,7 @@ jobs: bundle config path api/vendor/bundle bundle install - name: Rubocop - run: cd api && bundle exec rubocop + run: cd api && bundle exec rubocop -c .rubocop.yml - name: Rails Best Practices run: cd api && bundle exec rails_best_practices -e "db/schema.rb,db/migrate,vendor,app/models/application_record.rb" - name: Rpec diff --git a/api/.rubocop.yml b/api/.rubocop.yml index d256d78..6aef8f7 100644 --- a/api/.rubocop.yml +++ b/api/.rubocop.yml @@ -12,7 +12,6 @@ inherit_from: # Common configuration. AllCops: # Include gemspec and Rakefile - TargetRubyVersion: 2.7 Include: - "app/**/*" - "lib/**/*" From 01a07741e9583dd9ab8ba0750a077c32ca8113b6 Mon Sep 17 00:00:00 2001 From: Hugh Do Date: Mon, 31 Aug 2020 13:22:37 +0700 Subject: [PATCH 45/49] caching test 16 --- api/.rubocop.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/api/.rubocop.yml b/api/.rubocop.yml index 6aef8f7..f112114 100644 --- a/api/.rubocop.yml +++ b/api/.rubocop.yml @@ -31,9 +31,6 @@ AllCops: - ".idea/**/*" - "**/.DS_Store" - "**/.keep" - inherit_mode: - merge: - - Exclude # Indent private/protected/public as deep as method definitions Layout/AccessModifierIndentation: From 3760c5a975c3a9cd2d478664aeb35237565d8ae3 Mon Sep 17 00:00:00 2001 From: Hugh Do Date: Mon, 31 Aug 2020 13:27:17 +0700 Subject: [PATCH 46/49] caching test 16 --- .github/workflows/deployment.yml | 4 ++-- api/.rubocop.yml | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/deployment.yml b/.github/workflows/deployment.yml index a7d55fc..9113509 100644 --- a/.github/workflows/deployment.yml +++ b/.github/workflows/deployment.yml @@ -10,14 +10,14 @@ jobs: - run: sudo gem install bundler:1.17.2 - uses: actions/cache@v2 with: - path: api/vendor/bundle + path: "./api/vendor/bundle" key: ${{ runner.os }}-gems-${{ hashFiles('**/Gemfile.lock') }} restore-keys: | ${{ runner.os }}-gems- - name: Install gemfilee run: | cd api - bundle config path api/vendor/bundle + bundle config path "./api/vendor/bundle" bundle install - name: Rubocop run: cd api && bundle exec rubocop -c .rubocop.yml diff --git a/api/.rubocop.yml b/api/.rubocop.yml index f112114..20950bb 100644 --- a/api/.rubocop.yml +++ b/api/.rubocop.yml @@ -19,6 +19,7 @@ AllCops: - "Gemfile" Exclude: - "vendor/**/*" + - "api/vendor/**/*" - "config/unicorn.rb" - "bin/*" - "db/**/*" From f804e0f7fdb62696e8310045278767d381f3f16b Mon Sep 17 00:00:00 2001 From: Hugh Do Date: Mon, 31 Aug 2020 13:30:11 +0700 Subject: [PATCH 47/49] caching test 17 --- api/config/environments/test.rb | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/api/config/environments/test.rb b/api/config/environments/test.rb index db5f9d6..9d6f4fd 100644 --- a/api/config/environments/test.rb +++ b/api/config/environments/test.rb @@ -1,7 +1,4 @@ -# The test environment is used exclusively to run your application's -# test suite. You never need to work with it otherwise. Remember that -# your test database is "scratch space" for the test suite and is wiped -# and recreated between test runs. Don't rely on the data there! + Rails.application.configure do # Settings specified here will take precedence over those in config/application.rb. From 9e9cb5727bb00aee90d8a835f1223401205647e3 Mon Sep 17 00:00:00 2001 From: Hugh Do Date: Mon, 31 Aug 2020 13:32:52 +0700 Subject: [PATCH 48/49] caching test 18 --- .github/workflows/deployment.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/deployment.yml b/.github/workflows/deployment.yml index 9113509..99de9c7 100644 --- a/.github/workflows/deployment.yml +++ b/.github/workflows/deployment.yml @@ -10,14 +10,14 @@ jobs: - run: sudo gem install bundler:1.17.2 - uses: actions/cache@v2 with: - path: "./api/vendor/bundle" + path: api/vendor/bundle key: ${{ runner.os }}-gems-${{ hashFiles('**/Gemfile.lock') }} restore-keys: | ${{ runner.os }}-gems- - name: Install gemfilee run: | cd api - bundle config path "./api/vendor/bundle" + bundle config path vendor/bundle bundle install - name: Rubocop run: cd api && bundle exec rubocop -c .rubocop.yml From e5980166eb3302cfd1b195ffad8f3553c865eb08 Mon Sep 17 00:00:00 2001 From: Hugh Do Date: Mon, 31 Aug 2020 13:35:25 +0700 Subject: [PATCH 49/49] caching test 19 --- api/config/environments/test.rb | 1 - 1 file changed, 1 deletion(-) diff --git a/api/config/environments/test.rb b/api/config/environments/test.rb index 9d6f4fd..88a1347 100644 --- a/api/config/environments/test.rb +++ b/api/config/environments/test.rb @@ -1,7 +1,6 @@ Rails.application.configure do - # Settings specified here will take precedence over those in config/application.rb. config.cache_classes = false config.action_view.cache_template_loading = true