From e814665756f7750671fe33c5eaf417e26937304d Mon Sep 17 00:00:00 2001 From: Geremia Taglialatela Date: Thu, 19 Sep 2024 14:16:21 +0200 Subject: [PATCH] Prefer `require_relative` for internal requires `require_relative` is preferred over `require` for files within the same project because it uses paths relative to the current file, making code more portable and less dependent on the load path. This change updates internal requires to use `require_relative` for consistency, performance, and improved portability. Ref: - ruby/psych#522 - ruby/logger#20 - ruby/rdoc#658 - panorama-ed/memo_wise#349 - rubocop/rubocop#8748 --- lib/memo_wise.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/memo_wise.rb b/lib/memo_wise.rb index 47248b8..15605a9 100644 --- a/lib/memo_wise.rb +++ b/lib/memo_wise.rb @@ -2,8 +2,8 @@ require "set" # Ruby < 3.2 does not load `set` by default. -require "memo_wise/internal_api" -require "memo_wise/version" +require_relative "memo_wise/internal_api" +require_relative "memo_wise/version" # MemoWise is the wise choice for memoization in Ruby. #