[DOC] Fix RDoc to match actual Kenrel.require behavior (#9180)

This commit is contained in:
hogelog 2023-12-12 07:13:54 +09:00 committed by GitHub
parent 69d60cc67b
commit 4a94ce8569
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

15
load.c
View File

@ -957,15 +957,14 @@ static VALUE rb_require_string_internal(VALUE fname, bool resurrect);
* If the filename starts with './' or '../', resolution is based on Dir.pwd.
*
* If the filename has the extension ".rb", it is loaded as a source file; if
* the extension is ".so", ".o", or ".dll", or the default shared library
* extension on the current platform, Ruby loads the shared library as a
* Ruby extension. Otherwise, Ruby tries adding ".rb", ".so", and so on
* to the name until found. If the file named cannot be found, a LoadError
* will be raised.
* the extension is ".so", ".o", or the default shared library extension on
* the current platform, Ruby loads the shared library as a Ruby extension.
* Otherwise, Ruby tries adding ".rb", ".so", and so on to the name until
* found. If the file named cannot be found, a LoadError will be raised.
*
* For Ruby extensions the filename given may use any shared library
* extension. For example, on Linux the socket extension is "socket.so" and
* <code>require 'socket.dll'</code> will load the socket extension.
* For Ruby extensions the filename given may use ".so" or ".o". For example,
* on Windows the socket extension is "socket.dll" and
* <code>require 'socket.so'</code> will load the socket extension.
*
* The absolute path of the loaded file is added to
* <code>$LOADED_FEATURES</code> (<code>$"</code>). A file will not be