Require files to be loaded only once

suggest change

Kernel#require loads a file only once. Later calls do not evaluate it again. A name with no directory separator is looked up in $LOAD_PATH. Extensions such as .rb and the platform's shared-library suffix (.so or .dll) can be omitted. A path such as ./file is resolved from the process's working directory.

require 'awesome_print'

Kernel#require_relative loads a file relative to the file that calls it.

# will search in directory myproj relative to current source file.
#
require_relative 'myproj/version'

Feedback about page:

Feedback:
Optional: your email if you want me to get back to you:



Table Of Contents