From 7fd0c7804aaa9fae901699057d2fcd387c6197c6 Mon Sep 17 00:00:00 2001 From: Kostiantyn Kostiuk Date: Sat, 9 Oct 2021 19:55:25 +0300 Subject: [PATCH] fixed rubocop warnings Signed-off-by: Kostiantyn Kostiuk --- Gemfile | 12 +++++------ Rakefile | 2 +- config.ru | 2 +- config/application.rb | 24 +++++++++++----------- config/boot.rb | 6 +++--- config/environment.rb | 2 +- config/environments/development.rb | 4 ++-- config/environments/production.rb | 10 ++++----- config/environments/test.rb | 4 ++-- config/initializers/backtrace_silencers.rb | 2 +- config/initializers/rails_admin.rb | 1 - config/initializers/wrap_parameters.rb | 2 +- config/spring.rb | 11 +++++----- 13 files changed, 40 insertions(+), 42 deletions(-) diff --git a/Gemfile b/Gemfile index 50c70ecb..8529588d 100644 --- a/Gemfile +++ b/Gemfile @@ -13,10 +13,10 @@ gem 'jbuilder', '~> 2.7' gem 'jquery-rails' gem 'pg', '~> 1.1' gem 'puma', '~> 5.0' -gem 'rails_admin', '~> 2.0' gem 'rails', '~> 6.1.4', '>= 6.1.4.1' -gem 'redis-namespace' +gem 'rails_admin', '~> 2.0' gem 'redis', '~> 4.0', require: %w[redis redis/connection/hiredis] +gem 'redis-namespace' gem 'sassc-rails' gem 'simple_form' gem 'uglifier' @@ -29,13 +29,13 @@ group :development, :test do end group :development do - gem 'rack-mini-profiler', '~> 2.0' - gem 'listen', '~> 3.3' - gem 'spring' gem 'bullet' gem 'capistrano' gem 'capistrano-rails' + gem 'listen', '~> 3.3' + gem 'rack-mini-profiler', '~> 2.0' + gem 'spring' 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: %i[mingw mswin x64_mingw jruby] diff --git a/Rakefile b/Rakefile index 9a5ea738..e85f9139 100644 --- a/Rakefile +++ b/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/config.ru b/config.ru index 4a3c09a6..ad1fbf29 100644 --- a/config.ru +++ b/config.ru @@ -1,6 +1,6 @@ # This file is used by Rack-based servers to start the application. -require_relative "config/environment" +require_relative 'config/environment' run Rails.application Rails.application.load_server diff --git a/config/application.rb b/config/application.rb index 45fe9891..69671a59 100644 --- a/config/application.rb +++ b/config/application.rb @@ -1,19 +1,19 @@ -require_relative "boot" +require_relative 'boot' -require "rails" +require 'rails' # Pick the frameworks you want: -require "active_model/railtie" -require "active_job/railtie" -require "active_record/railtie" -require "active_storage/engine" -require "action_controller/railtie" -require "action_mailer/railtie" +require 'active_model/railtie' +require 'active_job/railtie' +require 'active_record/railtie' +require 'active_storage/engine' +require 'action_controller/railtie' +require 'action_mailer/railtie' # require "action_mailbox/engine" # require "action_text/engine" -require "action_view/railtie" -require "action_cable/engine" -require "sprockets/railtie" -require "rails/test_unit/railtie" +require 'action_view/railtie' +require 'action_cable/engine' +require 'sprockets/railtie' +require 'rails/test_unit/railtie' # Require the gems listed in Gemfile, including any gems # you've limited to :test, :development, or :production. diff --git a/config/boot.rb b/config/boot.rb index 3cda23b4..134b2d3f 100644 --- a/config/boot.rb +++ b/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/config/environment.rb b/config/environment.rb index cac53157..426333bb 100644 --- a/config/environment.rb +++ b/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/config/environments/development.rb b/config/environments/development.rb index 7a9f6c3a..e414f618 100644 --- a/config/environments/development.rb +++ b/config/environments/development.rb @@ -1,4 +1,4 @@ -require "active_support/core_ext/integer/time" +require 'active_support/core_ext/integer/time' Rails.application.configure do # Settings specified here will take precedence over those in config/application.rb. @@ -22,7 +22,7 @@ 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 diff --git a/config/environments/production.rb b/config/environments/production.rb index eac59879..4c1fe338 100644 --- a/config/environments/production.rb +++ b/config/environments/production.rb @@ -1,4 +1,4 @@ -require "active_support/core_ext/integer/time" +require 'active_support/core_ext/integer/time' Rails.application.configure do # Settings specified here will take precedence over those in config/application.rb. @@ -54,7 +54,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 @@ -89,10 +89,10 @@ # require "syslog/logger" # config.logger = ActiveSupport::TaggedLogging.new(Syslog::Logger.new 'app-name') - if ENV["RAILS_LOG_TO_STDOUT"].present? - logger = ActiveSupport::Logger.new(STDOUT) + if ENV['RAILS_LOG_TO_STDOUT'].present? + logger = ActiveSupport::Logger.new $stdout logger.formatter = config.log_formatter - config.logger = ActiveSupport::TaggedLogging.new(logger) + config.logger = ActiveSupport::TaggedLogging.new logger end # Do not dump schema after migrations. diff --git a/config/environments/test.rb b/config/environments/test.rb index 93ed4f1b..eace8401 100644 --- a/config/environments/test.rb +++ b/config/environments/test.rb @@ -1,4 +1,4 @@ -require "active_support/core_ext/integer/time" +require 'active_support/core_ext/integer/time' # The test environment is used exclusively to run your application's # test suite. You never need to work with it otherwise. Remember that @@ -19,7 +19,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/config/initializers/backtrace_silencers.rb b/config/initializers/backtrace_silencers.rb index 33699c30..d4d9b3b9 100644 --- a/config/initializers/backtrace_silencers.rb +++ b/config/initializers/backtrace_silencers.rb @@ -5,4 +5,4 @@ # You can also remove all the silencers if you're trying to debug a problem that might stem from framework code # by setting BACKTRACE=1 before calling your invocation, like "BACKTRACE=1 ./bin/rails runner 'MyClass.perform'". -Rails.backtrace_cleaner.remove_silencers! if ENV["BACKTRACE"] +Rails.backtrace_cleaner.remove_silencers! if ENV['BACKTRACE'] diff --git a/config/initializers/rails_admin.rb b/config/initializers/rails_admin.rb index 87e5e1ab..fd4a402a 100644 --- a/config/initializers/rails_admin.rb +++ b/config/initializers/rails_admin.rb @@ -1,7 +1,6 @@ require Rails.root.join 'lib/rails_admin/config/fields/types/citext' RailsAdmin.config do |config| - ### Popular gems integration ## == Devise == diff --git a/config/initializers/wrap_parameters.rb b/config/initializers/wrap_parameters.rb index bbfc3961..154143a8 100644 --- a/config/initializers/wrap_parameters.rb +++ b/config/initializers/wrap_parameters.rb @@ -4,7 +4,7 @@ # is enabled by default. # Enable parameter wrapping for JSON. You can disable this by setting :format to an empty array. -ActiveSupport.on_load(:action_controller) do +ActiveSupport.on_load :action_controller do wrap_parameters format: [:json] end diff --git a/config/spring.rb b/config/spring.rb index db5bf130..3b69434b 100644 --- a/config/spring.rb +++ b/config/spring.rb @@ -1,6 +1,5 @@ -Spring.watch( - ".ruby-version", - ".rbenv-vars", - "tmp/restart.txt", - "tmp/caching-dev.txt" -) +Spring.watch \ + '.ruby-version', + '.rbenv-vars', + 'tmp/restart.txt', + 'tmp/caching-dev.txt'