class Zeitwerk::Loader
def for_gem(warn_on_extra_files: true)
is private, client code can only rely on the interface.
This method returns a subclass of Zeitwerk::Loader, but the exact type
the same file, in the unlikely case the gem wants to be able to reload.
except that this method returns the same object in subsequent calls from
loader.push_dir(__dir__)
loader.inflector = Zeitwerk::GemInflector.new(__FILE__)
loader.tag = File.basename(__FILE__, ".rb")
loader = Zeitwerk::Loader.new
require "zeitwerk"
This is a shortcut for
def for_gem(warn_on_extra_files: true) called_from = caller_locations(1, 1).first.path Registry.loader_for_gem(called_from, namespace: Object, warn_on_extra_files: warn_on_extra_files) end