diff --git a/lib/mnemosyne/probes.rb b/lib/mnemosyne/probes.rb index 8a7b738..d249e48 100644 --- a/lib/mnemosyne/probes.rb +++ b/lib/mnemosyne/probes.rb @@ -21,18 +21,18 @@ def registry @registry ||= ::Mnemosyne::Registry.new end end + end +end - module Loader - module_function +module Kernel + module_function - def require(name) - super(name).tap do - ::Mnemosyne::Probes.required(name) - rescue Exception # rubocop:disable Lint/RescueException,Lint/SuppressedException - end - end - end + alias require_without_mnemosyne require - ::Kernel.prepend(Loader) + def require(name) + require_without_mnemosyne(name).tap do + ::Mnemosyne::Probes.required(name) + rescue Exception # rubocop:disable Lint/RescueException,Lint/SuppressedException + end end end