Skip to content

Commit

Permalink
fix: Kernel hook via preload broke Rails app
Browse files Browse the repository at this point in the history
Maybe related to zeitwerk/bootsnap aliasing require too.
  • Loading branch information
jgraichen committed Dec 18, 2024
1 parent 3d1f6da commit 94c3268
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions lib/mnemosyne/probes.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 94c3268

Please sign in to comment.