From: "ioquatix (Samuel Williams) via ruby-core" Date: 2026-02-12T01:00:37+00:00 Subject: [ruby-core:124773] [Ruby Feature#18841] Proposal: autoload_relative Issue #18841 has been updated by ioquatix (Samuel Williams). Status changed from Open to Closed Closing in favour of https://bugs.ruby-lang.org/issues/15330 ---------------------------------------- Feature #18841: Proposal: autoload_relative https://bugs.ruby-lang.org/issues/18841#change-116382 * Author: fxn (Xavier Noria) * Status: Closed ---------------------------------------- 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](https://github.com/rails/rails/blob/main/activerecord/lib/active_record.rb). (Those ones do not have a second argument because we define wrapper that derives it by convention, [here](https://github.com/rails/rails/blob/main/activesupport/lib/active_support/dependencies/autoload.rb)). 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. -- https://bugs.ruby-lang.org/ ______________________________________________ ruby-core mailing list -- ruby-core@ml.ruby-lang.org To unsubscribe send an email to ruby-core-leave@ml.ruby-lang.org ruby-core info -- https://ml.ruby-lang.org/mailman3/lists/ruby-core.ml.ruby-lang.org/