From ece571781039b7c8f95023703b66395998fe744f Mon Sep 17 00:00:00 2001 From: Marc-Andre Lafortune Date: Mon, 7 Aug 2023 19:36:03 -0400 Subject: [PATCH] Support Ruby 3.2 --- .github/workflows/require_relative_dir.yml | 2 +- lib/require_relative_dir.rb | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/.github/workflows/require_relative_dir.yml b/.github/workflows/require_relative_dir.yml index 352cad4..34b1523 100644 --- a/.github/workflows/require_relative_dir.yml +++ b/.github/workflows/require_relative_dir.yml @@ -15,7 +15,7 @@ jobs: fail-fast: false matrix: os: [ ubuntu ] - ruby: [ 2.1, 2.2, 2.3, 2.4, 2.5, 2.6, 2.7, '3.0', head ] + ruby: [ 2.1, 2.2, 2.3, 2.4, 2.5, 2.6, 2.7, '3.0', 3.1, 3.2, head ] usage: [ modern, legacy ] steps: - name: checkout diff --git a/lib/require_relative_dir.rb b/lib/require_relative_dir.rb index 1b40b6b..f830769 100644 --- a/lib/require_relative_dir.rb +++ b/lib/require_relative_dir.rb @@ -16,7 +16,11 @@ def require_relative_dir(dir_name = SAME_AS_CALLER_NAME, except: nil, first: nil end refine Object do - include RequireRelativeDir + if respond_to?(:import_methods, true) + import_methods RequireRelativeDir + else + include RequireRelativeDir + end private :require_relative_dir end