Class: Rivulet::Steps::LoadApp

Inherits:
Rivulet::Step show all
Defined in:
lib/rivulet/steps/load_app.rb

Instance Method Summary collapse

Methods inherited from Rivulet::Step

container_class_path, inherited

Instance Method Details

#call(input) ⇒ Object



6
7
8
9
10
11
12
13
14
15
16
17
# File 'lib/rivulet/steps/load_app.rb', line 6

def call(input)
  app_dir = File.expand_path('app')
  return Success(input) unless Dir.exist?(app_dir)

  loader = Zeitwerk::Loader.new
  loader.push_dir(app_dir)
  loader.push_dir("#{app_dir}/models")
  loader.setup
  loader.eager_load

  Success(input)
end