Issue #11140 has been updated by hsbt (Hiroshi SHIBATA).

Status changed from Assigned to Closed

This patch was already applied.

----------------------------------------
Feature #11140: Allow rubygems' `require` to handle `autoload` calls
https://bugs.ruby-lang.org/issues/11140#change-77286

* Author: tenderlovemaking (Aaron Patterson)
* Status: Closed
* Priority: Normal
* Assignee: tenderlovemaking (Aaron Patterson)
* Target version: 
----------------------------------------
Right now, rubygems can't handle calls to `autoload` because `autoload` will directly call `rb_require_safe` rather than sending to `Kernel::require`.

For example:

~~~ruby
class A
  autoload :B, 'a/b' # this is in a different Gem
end
A::B
~~~

The above code won't work because 'a/b' is in a different gem.  I'd like to give rubygems the opportunity to handle requires made through `autoload`.

I've attached a patch that makes the change.


---Files--------------------------------
call_send_on_autoload.diff (1.31 KB)


-- 
https://bugs.ruby-lang.org/

Unsubscribe: <mailto:ruby-core-request / ruby-lang.org?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-core>