Project

General

Profile

Actions

Feature #18841

open

Proposal: autoload_relative

Added by fxn (Xavier Noria) almost 2 years ago. Updated about 1 year ago.

Status:
Open
Assignee:
-
Target version:
-
[ruby-core:109003]

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.


Related issues 1 (1 open0 closed)

Related to Ruby master - Feature #15330: autoload_relativeOpenmatz (Yukihiro Matsumoto)Actions
Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like0Like0Like0