Class: RSMP::SchemaCLI

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

Overview

CLI subcommands for SXL schema operations.

Instance Method Summary collapse

Instance Method Details

#generateObject



11
12
13
14
15
16
17
18
19
20
# File 'lib/rsmp/cli.rb', line 11

def generate
  input  = options[:in]
  output = options[:out]
  unless File.exist?(input)
    puts "Error: Input file #{input} not found"
    exit 1
  end
  sxl = RSMP::Convert::Import::YAML.read(input)
  RSMP::Convert::Export::JSONSchema.write(sxl, output)
end