From 1c99b41242551b2ae0eb8a478bda23e480495086 Mon Sep 17 00:00:00 2001 From: Jakob Skjerning Date: Fri, 6 Dec 2024 11:10:59 +0100 Subject: [PATCH 1/2] Appease standardrb --- lib/route_downcaser/configuration.rb | 6 +++--- lib/route_downcaser/downcase_route_middleware.rb | 2 +- lib/tasks/route_downcaser_tasks.rake | 1 + 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/lib/route_downcaser/configuration.rb b/lib/route_downcaser/configuration.rb index 2b1eef5..e056d4a 100644 --- a/lib/route_downcaser/configuration.rb +++ b/lib/route_downcaser/configuration.rb @@ -7,14 +7,14 @@ def configuration end def define_setting(name, default = nil) - class_variable_set("@@#{name}", default) + class_variable_set(:"@@#{name}", default) define_class_method "#{name}=" do |value| - class_variable_set("@@#{name}", value) + class_variable_set(:"@@#{name}", value) end define_class_method name do - class_variable_get("@@#{name}") + class_variable_get(:"@@#{name}") end end diff --git a/lib/route_downcaser/downcase_route_middleware.rb b/lib/route_downcaser/downcase_route_middleware.rb index f28daa7..7037128 100644 --- a/lib/route_downcaser/downcase_route_middleware.rb +++ b/lib/route_downcaser/downcase_route_middleware.rb @@ -20,7 +20,7 @@ def _call(env) # Downcase path_info if applicable path_info = downcased_uri(path_info) - path_info = path_info.gsub('%7E', '~') if path_info + path_info = path_info.gsub("%7E", "~") if path_info # If redirect configured, then return redirect request, if either # path_info has changed diff --git a/lib/tasks/route_downcaser_tasks.rake b/lib/tasks/route_downcaser_tasks.rake index 165cee6..b5144c0 100644 --- a/lib/tasks/route_downcaser_tasks.rake +++ b/lib/tasks/route_downcaser_tasks.rake @@ -1,4 +1,5 @@ # frozen_string_literal: true + # desc "Explaining what the task does" # task :route_downcaser do # # Task goes here From 926338956e6914bd7983b1dd286f1aab9c3c6bd6 Mon Sep 17 00:00:00 2001 From: Jakob Skjerning Date: Fri, 6 Dec 2024 11:18:07 +0100 Subject: [PATCH 2/2] Only run rails main on newer Rubies rails main has a requirement of Ruby >= 3.2 so all Ruby versions before that fails with errors like Could not find compatible versions > Because every version of rails depends on Ruby >= 3.2.0 > and Gemfile depends on rails >= 0, > Ruby >= 3.2.0 is required. > So, because current Ruby version is = 2.7.8, > version solving has failed.Could not find compatible versions --- .github/workflows/ruby.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.github/workflows/ruby.yml b/.github/workflows/ruby.yml index d0e5e5c..8876e18 100644 --- a/.github/workflows/ruby.yml +++ b/.github/workflows/ruby.yml @@ -27,6 +27,12 @@ jobs: exclude: - rails-version: '5.2.8.1' ruby-version: '3.3' + - rails-version: 'main' + ruby-version: '2.7' + - rails-version: 'main' + ruby-version: '3.0' + - rails-version: 'main' + ruby-version: '3.1' env: RAILS_VERSION: ${{ matrix.rails-version }}