From 58f31333f0bb1c14bf0612a8b1a0b23b4f43f729 Mon Sep 17 00:00:00 2001 From: Eric Pugh Date: Fri, 4 Oct 2024 11:26:08 -0400 Subject: [PATCH] rubocop --- Gemfile | 4 ++-- app.json | 2 +- app/controllers/application_controller.rb | 2 +- config/environments/development.rb | 8 ++++---- config/environments/test.rb | 8 ++++---- config/initializers/new_framework_defaults_7_2.rb | 2 ++ config/routes.rb | 8 ++++---- test/controllers/proxy_controller_test.rb | 5 ++--- 8 files changed, 20 insertions(+), 19 deletions(-) diff --git a/Gemfile b/Gemfile index 9043ccd1c..19f9d6f76 100755 --- a/Gemfile +++ b/Gemfile @@ -58,7 +58,7 @@ gem 'vega', '~> 0.3.0' group :development, :test do # See https://guides.rubyonrails.org/debugging_rails_applications.html#debugging-with-the-debug-gem - gem "debug", platforms: %i[ mri windows ], require: "debug/prelude" + gem 'debug', platforms: [ :mri, :windows ], require: 'debug/prelude' gem 'annotate' gem 'bullet' gem 'memory_profiler' @@ -70,7 +70,7 @@ group :development do # this was commented out in the default build, so doing the same.. # Add speed badges [https://github.com/MiniProfiler/rack-mini-profiler] - #gem 'rack-mini-profiler' + # gem 'rack-mini-profiler' gem 'derailed_benchmarks' gem 'letter_opener' diff --git a/app.json b/app.json index 80a76557d..e95b15ec1 100644 --- a/app.json +++ b/app.json @@ -97,5 +97,5 @@ }, "scripts": { }, - "stack": "heroku-22" + "stack": "heroku-24" } diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index e267f21a1..b110c52a2 100755 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -6,7 +6,7 @@ class ApplicationController < ActionController::Base include Authentication::CurrentUserManager include Authentication::CurrentCaseManager include Authentication::CurrentBookManager - + # Only allow modern browsers supporting webp images, web push, badges, import maps, CSS nesting, and CSS :has. allow_browser versions: :modern diff --git a/config/environments/development.rb b/config/environments/development.rb index 3e219fb84..d307fffc2 100755 --- a/config/environments/development.rb +++ b/config/environments/development.rb @@ -27,7 +27,7 @@ config.action_controller.perform_caching = true config.cache_store = :memory_store - config.public_file_server.headers = { "Cache-Control" => "public, max-age=#{2.days.to_i}" } + config.public_file_server.headers = { 'Cache-Control' => "public, max-age=#{2.days.to_i}" } else config.action_controller.perform_caching = false @@ -41,9 +41,9 @@ # Don't care if the mailer can't send. config.action_mailer.raise_delivery_errors = false - + # Disable caching for Action Mailer templates even if Action Controller - # caching is enabled. + # caching is enabled. config.action_mailer.perform_caching = false # Print deprecation notices to the Rails logger. @@ -113,7 +113,7 @@ :transmissions, :state_updates ] - + # Apply autocorrection by RuboCop to files generated by `bin/rails generate`. # config.generators.apply_rubocop_autocorrect_after_generate! end diff --git a/config/environments/test.rb b/config/environments/test.rb index ca2283064..824f2d47e 100755 --- a/config/environments/test.rb +++ b/config/environments/test.rb @@ -20,7 +20,7 @@ config.eager_load = ENV['CI'].present? # Configure public file server for tests with Cache-Control for performance. - config.public_file_server.headers = { "Cache-Control" => "public, max-age=#{1.hour.to_i}" } + config.public_file_server.headers = { 'Cache-Control' => "public, max-age=#{1.hour.to_i}" } # Show full error reports and disable caching. config.consider_all_requests_local = true @@ -37,7 +37,7 @@ config.active_storage.service = :test # Disable caching for Action Mailer templates even if Action Controller - # caching is enabled. + # caching is enabled. config.action_mailer.perform_caching = false # Tell Action Mailer not to deliver emails to the real world. @@ -48,7 +48,7 @@ # Unlike controllers, the mailer instance doesn't have any context about the # incoming request so you'll need to provide the :host parameter yourself. config.action_mailer.default_url_options = { host: 'localhost', port: '3000' } - + # Print deprecation notices to the stderr. config.active_support.deprecation = :stderr @@ -78,7 +78,7 @@ # Raise error when a before_action's only/except options reference missing actions. config.action_controller.raise_on_missing_callback_actions = true - + config.active_job.queue_adapter = :test ENV['TC_URL'] = 'https://quepid.com/agreement' diff --git a/config/initializers/new_framework_defaults_7_2.rb b/config/initializers/new_framework_defaults_7_2.rb index b549c4a25..0344a6d02 100644 --- a/config/initializers/new_framework_defaults_7_2.rb +++ b/config/initializers/new_framework_defaults_7_2.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + # Be sure to restart your server when you modify this file. # # This file eases your Rails 7.2 framework defaults upgrade. diff --git a/config/routes.rb b/config/routes.rb index be4babb1c..6449a581a 100755 --- a/config/routes.rb +++ b/config/routes.rb @@ -7,11 +7,11 @@ apipie mount ActiveStorageDB::Engine => '/active_storage_db' Healthcheck.routes(self) - + # Render dynamic PWA files from app/views/pwa/* - get "service-worker" => "rails/pwa#service_worker", as: :pwa_service_worker - get "manifest" => "rails/pwa#manifest", as: :pwa_manifest - + get 'service-worker' => 'rails/pwa#service_worker', as: :pwa_service_worker + get 'manifest' => 'rails/pwa#manifest', as: :pwa_manifest + # Reveal health status on /up that returns 200 if the app boots with no exceptions, otherwise 500. # Can be used by load balancers and uptime monitors to verify that the app is live. get 'up' => 'rails/health#show', as: :rails_health_check diff --git a/test/controllers/proxy_controller_test.rb b/test/controllers/proxy_controller_test.rb index 32d9eab6f..99a5e7e1f 100644 --- a/test/controllers/proxy_controller_test.rb +++ b/test/controllers/proxy_controller_test.rb @@ -4,13 +4,12 @@ # rubocop:disable Layout/LineLength class ProxyControllerTest < ActionDispatch::IntegrationTest - test 'should require a url query parameter' do get proxy_fetch_path assert_response :bad_request - + post proxy_fetch_path - assert_response :bad_request + assert_response :bad_request end test 'should be able to handle a get' do