diff --git a/Rakefile b/Rakefile index 82bb534..c6435b8 100644 --- a/Rakefile +++ b/Rakefile @@ -2,7 +2,9 @@ require 'bundler/gem_tasks' require 'rspec/core/rake_task' +require 'rubocop/rake_task' RSpec::Core::RakeTask.new(:spec) +RuboCop::RakeTask.new(:rubocop) task default: :spec diff --git a/spec/dummy/config/environments/production.rb b/spec/dummy/config/environments/production.rb index 32841c1..0b4bc9c 100644 --- a/spec/dummy/config/environments/production.rb +++ b/spec/dummy/config/environments/production.rb @@ -62,7 +62,7 @@ # config.logger = ActiveSupport::TaggedLogging.new(Syslog::Logger.new 'app-name') if ENV['RAILS_LOG_TO_STDOUT'].present? - logger = ActiveSupport::Logger.new(STDOUT) + logger = ActiveSupport::Logger.new($stdout) logger.formatter = config.log_formatter config.logger = ActiveSupport::TaggedLogging.new(logger) end diff --git a/spec/dummy/config/puma.rb b/spec/dummy/config/puma.rb index 6d84069..69e2645 100644 --- a/spec/dummy/config/puma.rb +++ b/spec/dummy/config/puma.rb @@ -6,20 +6,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 } +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/spec/spec_helper.rb b/spec/spec_helper.rb index 7d11c4f..11466a8 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -8,7 +8,7 @@ require './app/controllers/healthcheck/healthchecks_controller' require File.expand_path('../spec/dummy/config/environment.rb', __dir__) -ENV['RAILS_ROOT'] ||= File.dirname(__FILE__) + '../../../spec/dummy' +ENV['RAILS_ROOT'] ||= "#{File.dirname(__FILE__)}../../../spec/dummy" require 'rspec/rails' require 'timecop'