From 56c7f0d6a6ac06da3c723bfc73860e05cc39577e Mon Sep 17 00:00:00 2001 From: Connor Ferguson <68167430+cpfergus1@users.noreply.github.com> Date: Tue, 10 Jan 2023 12:49:03 -0700 Subject: [PATCH] Add Double Splat to `load_paths` Call In Ruby 3.0, positional arguments and keyword arguments were separated. In Ruby 3, a method delegating all arguments must explicitly delegate keyword arguments in addition to positional arguments. In most cases, we can avoid the incompatibility by adding the double splat operator. It explicitly specifies passing keyword arguments instead of a Hash object. Without this fix, applications utilizing Ruby 3+ would pass the options hash with `prependers_directories` https://www.ruby-lang.org/en/news/2019/12/12/separation-of-positional-and-keyword-arguments-in-ruby-3-0/ --- lib/prependers.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/prependers.rb b/lib/prependers.rb index cd98cdb..dd7c8bc 100644 --- a/lib/prependers.rb +++ b/lib/prependers.rb @@ -23,7 +23,7 @@ def self.setup_for_rails(load_options = {}) config.autoload_paths += prependers_directories config.to_prepare do - Prependers.load_paths(prependers_directories, load_options) + Prependers.load_paths(prependers_directories, **load_options) end end end