Class: Lutaml::Xsd::Commands::GenerateSpaCommand

Inherits:
BaseCommand
  • Object
show all
Defined in:
lib/lutaml/xsd/commands/generate_spa_command.rb

Overview

CLI command for generating SPA documentation

Generates interactive HTML Single Page Application documentation from XSD schemas with Vue.js frontend.

Instance Attribute Summary collapse

Attributes inherited from BaseCommand

#options

Instance Method Summary collapse

Constructor Details

#initialize(package_path, options = {}) ⇒ GenerateSpaCommand

Initialize spa command

Parameters:

  • package_path (String)

    Path to LXR package file

  • options (Hash) (defaults to: {})

    Command options



20
21
22
23
24
# File 'lib/lutaml/xsd/commands/generate_spa_command.rb', line 20

def initialize(package_path, options = {})
  super(options)
  @package_path = package_path
  @output_path = options[:output]
end

Instance Attribute Details

#output_pathObject (readonly)

Returns the value of attribute output_path.



14
15
16
# File 'lib/lutaml/xsd/commands/generate_spa_command.rb', line 14

def output_path
  @output_path
end

#package_pathObject (readonly)

Returns the value of attribute package_path.



14
15
16
# File 'lib/lutaml/xsd/commands/generate_spa_command.rb', line 14

def package_path
  @package_path
end

Instance Method Details

#runvoid

This method returns an undefined value.

Run SPA generation command



29
30
31
32
33
34
35
36
37
38
39
40
# File 'lib/lutaml/xsd/commands/generate_spa_command.rb', line 29

def run
  validate_inputs
  package = load_package
  generator = create_generator(package)

  output_files = generator.generate
  display_results(output_files)
rescue StandardError => e
  error "SPA generation failed: #{e.message}"
  verbose_output e.backtrace.join("\n") if verbose?
  exit 1
end