diff --git a/.generator/templates/Gemfile.mustache b/.generator/templates/Gemfile.mustache index 69255e559f7..c2e3127cdcf 100644 --- a/.generator/templates/Gemfile.mustache +++ b/.generator/templates/Gemfile.mustache @@ -3,7 +3,7 @@ source 'https://rubygems.org' gemspec group :development, :test do - gem 'rake', '~> 12.0.0' + gem 'rake', '~> 13.0.1' gem 'pry-byebug' gem 'rubocop', '~> 0.66.0' end diff --git a/.generator/templates/api_client.mustache b/.generator/templates/api_client.mustache index 5d263ece7e3..f3139eaa46e 100644 --- a/.generator/templates/api_client.mustache +++ b/.generator/templates/api_client.mustache @@ -158,11 +158,13 @@ module {{moduleName}} tempfile.write(chunk) end request.on_complete do |response| - tempfile.close if tempfile - @config.logger.info "Temp file written to #{tempfile.path}, please copy the file to a proper folder "\ - "with e.g. `FileUtils.cp(tempfile.path, '/new/file/path')` otherwise the temp file "\ - "will be deleted automatically with GC. It's also recommended to delete the temp file "\ - "explicitly with `tempfile.delete`" + if tempfile + tempfile.close + @config.logger.info "Temp file written to #{tempfile.path}, please copy the file to a proper folder "\ + "with e.g. `FileUtils.cp(tempfile.path, '/new/file/path')` otherwise the temp file "\ + "will be deleted automatically with GC. It's also recommended to delete the temp file "\ + "explicitly with `tempfile.delete`" + end end end diff --git a/.generator/templates/api_client_spec.mustache b/.generator/templates/api_client_spec.mustache index 364c60419c4..a079cc9fd35 100644 --- a/.generator/templates/api_client_spec.mustache +++ b/.generator/templates/api_client_spec.mustache @@ -150,7 +150,7 @@ describe {{moduleName}}::ApiClient do end it 'fails for invalid collection format' do - expect{api_client.build_collection_param(param, :INVALID)}.to raise_error(RuntimeError, 'unknown collection format: :INVALID') + expect { api_client.build_collection_param(param, :INVALID) }.to raise_error(RuntimeError, 'unknown collection format: :INVALID') end end diff --git a/.generator/templates/rubocop.mustache b/.generator/templates/rubocop.mustache index 0ef33ce5e32..df46058490d 100644 --- a/.generator/templates/rubocop.mustache +++ b/.generator/templates/rubocop.mustache @@ -14,12 +14,6 @@ AllCops: Style/AndOr: Enabled: true -# Do not use braces for hash literals when they are the last argument of a -# method call. -Style/BracesAroundHashParameters: - Enabled: true - EnforcedStyle: context_dependent - # Align `when` with `case`. Layout/CaseIndentation: Enabled: true @@ -46,7 +40,7 @@ Layout/EmptyLinesAroundMethodBody: Layout/EmptyLinesAroundModuleBody: Enabled: true -Layout/IndentFirstArgument: +Layout/FirstArgumentIndentation: Enabled: true # Use Ruby >= 1.9 syntax for hashes. Prefer { a: :b } over { :a => :b }. @@ -57,7 +51,7 @@ Style/HashSyntax: # extra level of indentation. Layout/IndentationConsistency: Enabled: true - EnforcedStyle: rails + EnforcedStyle: indented_internal_methods # Two spaces, no tabs (for indentation). Layout/IndentationWidth: @@ -123,7 +117,7 @@ Layout/Tab: Enabled: true # Blank lines should not have any spaces. -Layout/TrailingBlankLines: +Layout/TrailingEmptyLines: Enabled: true # No trailing whitespace. @@ -131,7 +125,7 @@ Layout/TrailingWhitespace: Enabled: false # Use quotes for string literals when they are enough. -Style/UnneededPercentQ: +Style/RedundantPercentQ: Enabled: true # Align `end` with the matching keyword or starting expression except for