Class: Inquirex::TTY::Commands::Validate
- Inherits:
-
Dry::CLI::Command
- Object
- Dry::CLI::Command
- Inquirex::TTY::Commands::Validate
- Defined in:
- lib/inquirex/tty/commands/validate.rb
Overview
Validates a flow definition file: start step exists, all transition targets are known, and every step is reachable from the start step.
Instance Method Summary collapse
Instance Method Details
#call(flow_file:) ⇒ void
This method returns an undefined value.
15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 |
# File 'lib/inquirex/tty/commands/validate.rb', line 15 def call(flow_file:, **) definition = FlowLoader.load(flow_file) errors = validate_definition(definition) if errors.empty? print_success(definition) else print_errors(errors) exit 1 end rescue Inquirex::TTY::Error => e warn "Error: #{e.}" exit 1 rescue Inquirex::Errors::Error => e warn "Definition error: #{e.}" exit 1 end |