Class: Roast::CLI

Inherits:
Thor
  • Object
show all
Defined in:
lib/roast.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.exit_on_failure?Boolean

Returns:

  • (Boolean)


32
33
34
# File 'lib/roast.rb', line 32

def exit_on_failure?
  true
end

Instance Method Details

#execute(*paths) ⇒ Object

Raises:

  • (Thor::Error)


21
22
23
24
25
26
27
28
29
# File 'lib/roast.rb', line 21

def execute(*paths)
  raise Thor::Error, "Workflow configuration file is required" if paths.empty?

  workflow_path, *files = paths
  expanded_workflow_path = File.expand_path(workflow_path)
  raise Thor::Error, "Expected a Roast workflow configuration file, got directory: #{expanded_workflow_path}" if File.directory?(expanded_workflow_path)

  Roast::Workflow::ConfigurationParser.new(expanded_workflow_path, files, options.transform_keys(&:to_sym)).begin!
end