No sorry JIm, your conclusion is incorrect.
Simply read the description for Kernel.require.
(1) The first file found is loaded.
(2) The user’s %AppData% path has precedence over the %ProgramData% path.
(The user may wish to copy a script from the latter into their own “Plugins” folder, and tweak it for personal use. This is very likely to happen in an educational setting.)
So, when specifying relative script paths, it depends upon the order of the basepaths in the
$LOAD_PATH array. The user’s “plugins” path should come before, the program’s “plugins” path.
If you wish a different order, you can change the
$LOAD_PATH order on your machine only, but do not expect others to do this.
The usual proper way, (of ignoring the
$LOAD_PATH order,) is to specify an absolute script path as the argument to Kernel.require.
If you were thinking that because the first “a.rb” has already been loaded, that Kernel.require should continue searching for another to load, that is incorrect. If it finds that the argument path has already been loaded, (by checking the $LOADED_FEATURES array,) an finds a member that has the argument as part of the pathstring, then it returns false, and does no search.
You would need to provide a more specific path argument to Kernel.require, that would not match the first “a.rb” but would match the second in %ProgramData%.