Anonymous user
Include a file: Difference between revisions
→{{header|Ruby}}
Line 688:
=={{header|Ruby}}==
Note that in Ruby, you don't use the file extension. Ruby will first check for a Ruby (.rb) file of the specified name and load it as a source file. If an .rb file is not found it will search for files in .so, .o, .dll or other shared-library formats and load them as Ruby extension. <lang Ruby>require</lang> will search in a series of pre-determined folders, while <lang Ruby>require_relative</lang> behaves the same way but searches in the current folder, or another specified folder.
<lang Ruby>require 'file'</lang>
|