Class: SpaceArchitect::CLI::Architect::Dispatch

Inherits:
Dry::CLI::Command
  • Object
show all
Includes:
GlobalOptions, Helpers
Defined in:
lib/space_architect/cli/architect.rb

Instance Method Summary collapse

Methods included from Helpers

#display_date, #handle_errors, #project_config, #render, #setup_terminal, #state, #store, #terminal

Methods included from GlobalOptions

included

Instance Method Details

#call(iteration:, lane:, space: nil, model: nil, max_turns: "200", harness: nil, effort: nil, **opts) ⇒ Object



178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
# File 'lib/space_architect/cli/architect.rb', line 178

def call(iteration:, lane:, space: nil, model: nil,
         max_turns: "200", harness: nil, effort: nil, **opts)
  setup_terminal(**opts.slice(:color, :colors))
  handle_errors do
    render(store.find(space)) do |sp|
      mission = ArchitectMission.new(space: sp)
      kwargs = { max_turns: max_turns.to_i }
      kwargs[:model]   = model   if model
      kwargs[:harness] = harness if harness
      kwargs[:effort]  = effort  if effort
      res = mission.dispatch(iteration, lane, **kwargs)
      terminal.say "Run log: #{terminal.path(res[:run_log])}"
      terminal.say "Report:  #{terminal.path(res[:report])}"
      terminal.say "Builder exited with status #{res[:exit_code]}"
      CLI.record_outcome(Outcome.new(exit_code: res[:exit_code]))
    end
  end
end