Module: Ufo::Booter

Extended by:
Booter
Included in:
Booter
Defined in:
lib/ufo/booter.rb

Instance Method Summary collapse

Instance Method Details

#bootObject



3
4
5
# File 'lib/ufo/booter.rb', line 3

def boot
  run_hooks
end

#run_hook(env = nil) ⇒ Object



19
20
21
22
23
# File 'lib/ufo/booter.rb', line 19

def run_hook(env=nil)
  name = env ? "boot/#{env}" : "boot"
  path = "#{Ufo.root}/.ufo/config/#{name}.rb" # IE: .ufo/boot/dev.rb
  require path if File.exist?(path)
end

#run_hooksObject

Special boot hooks run super early. Useful for setting env vars and other early things.

.ufo/boot.rb
.ufo/boot/dev.rb


13
14
15
16
17
# File 'lib/ufo/booter.rb', line 13

def run_hooks
  run_hook
  run_hook(Ufo.env)
  Ufo::Config::Inits.run_all
end