Ruby Kernel#require Method
The Ruby Kernel#require
method1:
- If
require
is called more than once with the same arguments it would not be reloaded if its already loaded. - Ruby keeps track of which files were already required.
- Usually you don’t need the extension when
require
ing a feature.
The Kernel#require_relative
method2 is very similar to require
:
- Behaving the same just in the same directory as the file that the code is executing from.
- Don’t need to manipulate the load path to get to the current folder