Class: Ace::Assign::CLI::Commands::Create

Inherits:
Support::Cli::Command
  • Object
show all
Includes:
Support::Cli::Base
Defined in:
lib/ace/assign/cli/commands/create.rb

Overview

Create a new workflow assignment from YAML or preset-backed task refs

Instance Method Summary collapse

Instance Method Details

#call(yaml: nil, task: nil, preset: nil, **options) ⇒ Object



20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
# File 'lib/ace/assign/cli/commands/create.rb', line 20

def call(yaml: nil, task: nil, preset: nil, **options)
  validate_modes!(yaml, task, preset)

  result = if yaml
    Organisms::AssignmentExecutor.new.start(yaml)
  else
    Organisms::TaskAssignmentCreator.new.call(
      task_refs: task,
      preset_name: preset || Organisms::TaskAssignmentCreator::DEFAULT_PRESET
    )
  end

  unless options[:quiet]
    print_terminal_skip_summary(result[:skipped_terminal])
    print_assignment_header(result[:assignment])
    print_step_instructions(result[:current])
  end
end