Application path helpers
Configuring the root directory
The application root directory is defined as the directory containing the core application file.
You can see its definition in the core application file:
There shouldn't be a need to change this, but feel free if it is necessary for your application.
The set_root
command also generates four helpers.
Root accessor
Eucalypt.root
simply returns the full application root directory path as a string.
Path constructor
Eucalypt.path
allows for the construction of absolute paths relative to the application root directory.
For example:
Glob helper
Eucalypt.glob
allows for the globbing of files relative to the application root directory. The method works in the same way as Dir.glob
, and also accepts a block that allows you to operate on the globbed files.
For example:
Require helper
Eucalypt.require
allows for the requiring of multiple files relative to the application root directory. Note that it is not possible to specify the order in which files are required.
Unlike Kernel
's require method, files must include their extensions.
For example:
Last updated