lib/pennyworth.rb in pennyworth-15.4.0 vs lib/pennyworth.rb in pennyworth-15.4.1
- old
+ new
@@ -11,7 +11,9 @@
loader.setup
end
# Main namespace.
module Pennyworth
- def self.loader(registry = Zeitwerk::Registry) = registry.loader_for __FILE__
+ def self.loader registry = Zeitwerk::Registry
+ @loader ||= registry.loaders.find { |loader| loader.tag == File.basename(__FILE__, ".rb") }
+ end
end