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