diff --git a/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb b/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb index 034a1ff..44d3285 100644 --- a/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb +++ b/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb @@ -1,9 +1,9 @@ # frozen_string_literal: true module Kernel - module_function + alias_method :require_without_bootsnap, :require - alias_method(:require_without_bootsnap, :require) + alias_method :require, :require # avoid redefinition warnings def require(path) return require_without_bootsnap(path) unless Bootsnap::LoadPathCache.enabled? @@ -34,4 +34,6 @@ def require(path) return ret end end + + private :require end