Class: Synthra::CLI::Commands::Validate

Inherits:
Base
  • Object
show all
Defined in:
lib/synthra/cli/commands/validate.rb

Overview

Validate command - validates DSL schema syntax

Examples:

synthra validate schemas/user.dsl

Instance Method Summary collapse

Constructor Details

This class inherits a constructor from Synthra::CLI::Commands::Base

Instance Method Details

#callObject



12
13
14
15
16
17
18
19
20
21
22
23
24
# File 'lib/synthra/cli/commands/validate.rb', line 12

def call
  path = args.shift

  unless path
    error "Usage: synthra validate <path>"
    return EXIT_PARSE_ERROR
  end

  registry = Registry.new
  registry.load_file(path)
  success "Schema valid: #{path}"
  EXIT_SUCCESS
end