Actions
Feature #18841
openProposal: autoload_relative
Status:
Open
Assignee:
-
Target version:
-
Description
In my experience, autoloads often reflect an existing hierarchical structure.
If a project does not use Zeitwerk, and the user declares autoloads for a class or module, chances are they are for child constants. As an example, see the ActiveRecord
module. (Those ones do not have a second argument because we define wrapper that derives it by convention, here).
I think it would be convenient to have an autoload_relative
in the line of Kernel#require_relative
. It would make existing patterns more concise, and as a practical consequence, you skip $LOAD_PATH
lookups too.
Actions
Like0
Like0Like0Like0Like0Like0Like0