Class: Space::Architect::CLI::Architect::Verdict

Inherits:
BaseCommand
  • Object
show all
Defined in:
lib/space_architect/cli/architect.rb

Instance Method Summary collapse

Methods inherited from BaseCommand

commit_message_options, phase

Instance Method Details

#call(iteration:, decision:, space: nil, from: nil, body: nil, stdin: false, message: nil, message_from: nil, **opts) ⇒ Object



450
451
452
453
454
455
456
457
458
459
460
461
462
463
# File 'lib/space_architect/cli/architect.rb', line 450

def call(iteration:, decision:, space: nil, from: nil, body: nil, stdin: false,
         message: nil, message_from: nil, **opts)
  setup_terminal(**opts.slice(:color, :colors))
  handle_errors do
    content = read_body(from: from, body: body, stdin: stdin, what: "verdict body")
    render(store.find(space)) do |sp|
      project = ArchitectProject.new(space: sp)
      res = project.record_verdict!(iteration, decision: decision, body: content,
        message: read_commit_message(message: message, message_from: message_from))
      terminal.say "Verdict '#{res[:decision]}' recorded → #{res[:sha][0, 8]}"
      CLI.record_outcome(Outcome.new(exit_code: 0))
    end
  end
end