Class: Ace::Overseer::CLI::Commands::Prepare

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

Instance Method Summary collapse

Constructor Details

#initialize(client: nil) ⇒ Prepare

Returns a new instance of Prepare.



15
16
17
18
# File 'lib/ace/overseer/cli/commands/prepare.rb', line 15

def initialize(client: nil)
  super()
  @client = client || Molecules::LabClient.new
end

Instance Method Details

#call(runtime:, project:, source:, work:, planner:, title:) ⇒ Object



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

def call(runtime:, project:, source:, work:, planner:, title:, **)
  raise Ace::Support::Cli::Error, "unsupported runtime: #{runtime}" unless runtime == "lab"
  puts @client.call(
    "work", "prepare", project,
    "--source", source,
    "--work", work,
    "--planner", planner,
    "--title", title,
    json: false
  )
rescue Ace::Support::Cli::Error
  raise
rescue => error
  raise Ace::Support::Cli::Error.new(error.message)
end