I do not understand the difference between the three methods of importing a library or module. As I understand it,
load 'file.rb'
imports the contents of an external file into the current file, whereas:
require 'file.rb'
will perform the same functions, but will not import an already imported file.
require_relative 'file.rb'
similar to require , but it will load a file that is only in the current directory, whereas require will use the search path $: in an attempt to find the file. I have no doubt that my understanding of these three mechanisms is erroneous. Can anyone provide clarification?
source share