Class: Ufo::Autoloader
- Inherits:
-
Object
- Object
- Ufo::Autoloader
- Defined in:
- lib/ufo/autoloader.rb
Defined Under Namespace
Classes: Inflector
Class Method Summary collapse
- .setup ⇒ Object
-
.ufo_root ⇒ Object
Autoloader runs so early that Ufo.root is not available, so we must declare it here.
Class Method Details
.setup ⇒ Object
13 14 15 16 17 18 19 20 21 22 |
# File 'lib/ufo/autoloader.rb', line 13 def setup loader = Zeitwerk::Loader.new loader.inflector = Inflector.new loader.push_dir(File.dirname(__dir__)) # lib helpers = "#{ufo_root}/.ufo/helpers" loader.push_dir(helpers) if File.exist?(helpers) # project helpers loader.setup end |
.ufo_root ⇒ Object
Autoloader runs so early that Ufo.root is not available, so we must declare it here
25 26 27 |
# File 'lib/ufo/autoloader.rb', line 25 def ufo_root ENV['UFO_ROOT'] || '.' end |