Class: Ace::Assign::CLI::Commands::Fail

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

Overview

Mark current step as failed

Instance Method Summary collapse

Instance Method Details

#call(**options) ⇒ Object



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

def call(**options)
  message = options[:message]

  target = resolve_assignment_target(options)
  executor = build_executor_for_target(target)
  result = executor.fail(message)

  unless options[:quiet]
    failed = result[:failed]
    puts "Step #{failed.number} (#{failed.name}) marked as failed"
    puts "Updated: #{File.basename(failed.file_path)}"
    puts "Error: #{message}"
    puts
    puts "Options:"
    puts "- ace-assign add \"fix-step\" to add a fix step"
    puts "- ace-assign retry #{failed.number} to retry this step"
  end
end