Class: Ace::Assign::CLI::Commands::Start

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

Overview

Start a pending step

Instance Method Summary collapse

Instance Method Details

#call(step: nil, **options) ⇒ Object



19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
# File 'lib/ace/assign/cli/commands/start.rb', line 19

def call(step: nil, **options)
  if step && options[:assignment]
    raise Error, "Positional STEP targeting is only supported for active assignment. Use --assignment without STEP for cross-assignment start."
  end

  target = resolve_assignment_target(options)
  executor = build_executor_for_target(target)
  result = executor.start_step(step_number: step, fork_root: target.scope)

  return if options[:quiet]

  started = result[:started]
  puts "Step #{started.number} (#{started.name}) started"
  puts "Next: ace-assign step#{step_target_suffix(started.number, options[:assignment])}"
end