Skip to content

Commit

Permalink
Merge pull request #88 from mnemosyne-mon/fix/require-alias
Browse files Browse the repository at this point in the history
fix: Kernel hook via preload broke Rails app
  • Loading branch information
jgraichen authored Dec 18, 2024
2 parents 3d1f6da + 94c3268 commit e20ad38
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 e20ad38

Please sign in to comment.