You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If a file that was already required matches the the required path, #require should return false, even if another file exist on the path which is earlier.
Note, the script just unshifts the path, but this is also for cases where a later file is loaded absolutely.
require'tmpdir'require'fileutils'defmake_ruby_file(dir,path)File.write("#{dir}/#{path}",<<-RUBY) puts "in " + #{path.inspect} RUBYend# #require should skip if any existing $LOADED_FEATURES already match $LOAD_PATH + path.Dir.mktmpdir('truffleruby_test')do |dir|
FileUtils.mkpath("#{dir}/one")FileUtils.mkpath("#{dir}/prepended")make_ruby_file(dir,'one/test.rb')make_ruby_file(dir,'prepended/test.rb')
$LOAD_PATH << "#{dir}/one"require'test'
$LOAD_PATH.unshift"#{dir}/prepended"require'test'end
In MRI: in one/test.rb
In JRuby: in one/test.rb
In TruffleRuby: