Class: Lutaml::Cli::UmlCommands

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

Overview

UmlCommands provides CLI commands for UML repository operations

This is the main CLI interface for working with UML models from XMI and QEA files. Follows MECE (Mutually Exclusive, Collectively Exhaustive) principles and Docker-like command conventions.

Command categories:

  • Resource Lifecycle: build, info, validate

  • Viewing: ls, inspect, tree, stats

  • Querying: search, find

  • Output: export, docs, serve

  • Development: repl, verify

This class serves as a thin delegation layer to individual command classes, keeping the Thor integration separate from business logic.

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.exit_on_failure?Boolean

Make Thor raise errors instead of exiting

Returns:

  • (Boolean)


25
26
27
# File 'lib/lutaml/cli/uml_commands.rb', line 25

def self.exit_on_failure?
  false
end

Instance Method Details

#build(model_path) ⇒ Object



39
40
41
# File 'lib/lutaml/cli/uml_commands.rb', line 39

def build(model_path)
  Uml::BuildCommand.new(options.to_h).run(model_path)
end

#build_spa(input_path) ⇒ Object



112
113
114
# File 'lib/lutaml/cli/uml_commands.rb', line 112

def build_spa(input_path)
  Uml::SpaCommand.new(options.to_h).run(input_path)
end

#diagram(action) ⇒ Object



124
125
126
# File 'lib/lutaml/cli/uml_commands.rb', line 124

def diagram(action, *)
  Uml::DiagramCommand.new(options.to_h).run(action, *)
end

#export(lur_path) ⇒ Object



105
106
107
# File 'lib/lutaml/cli/uml_commands.rb', line 105

def export(lur_path)
  Uml::ExportCommand.new(options.to_h).run(lur_path)
end

#find(lur_path) ⇒ Object



95
96
97
# File 'lib/lutaml/cli/uml_commands.rb', line 95

def find(lur_path)
  Uml::FindCommand.new(options.to_h).run(lur_path)
end

#info(lur_path) ⇒ Object



45
46
47
# File 'lib/lutaml/cli/uml_commands.rb', line 45

def info(lur_path)
  Uml::InfoCommand.new(options.to_h).run(lur_path)
end

#inspect(lur_path, element_id) ⇒ Object



67
68
69
# File 'lib/lutaml/cli/uml_commands.rb', line 67

def inspect(lur_path, element_id)
  Uml::InspectCommand.new(options.to_h).run(lur_path, element_id)
end

#list(lur_path, path = nil) ⇒ Object



61
62
63
# File 'lib/lutaml/cli/uml_commands.rb', line 61

def list(lur_path, path = nil)
  Uml::LsCommand.new(options.to_h).run(lur_path, path)
end

#repl(lur_path) ⇒ Object



134
135
136
# File 'lib/lutaml/cli/uml_commands.rb', line 134

def repl(lur_path)
  Uml::ReplCommand.new(options.to_h).run(lur_path)
end

#search(lur_path, query) ⇒ Object



89
90
91
# File 'lib/lutaml/cli/uml_commands.rb', line 89

def search(lur_path, query)
  Uml::SearchCommand.new(options.to_h).run(lur_path, query)
end

#serve(lur_path) ⇒ Object



118
119
120
# File 'lib/lutaml/cli/uml_commands.rb', line 118

def serve(lur_path)
  Uml::ServeCommand.new(options.to_h).run(lur_path)
end

#stats(lur_path, path = nil) ⇒ Object



79
80
81
# File 'lib/lutaml/cli/uml_commands.rb', line 79

def stats(lur_path, path = nil)
  Uml::StatsCommand.new(options.to_h).run(lur_path, path)
end

#tree(lur_path, path = nil) ⇒ Object



73
74
75
# File 'lib/lutaml/cli/uml_commands.rb', line 73

def tree(lur_path, path = nil)
  Uml::TreeCommand.new(options.to_h).run(lur_path, path)
end

#validate(file_path) ⇒ Object



51
52
53
# File 'lib/lutaml/cli/uml_commands.rb', line 51

def validate(file_path)
  Uml::ValidateCommand.new(options.to_h).run(file_path)
end

#verify(xmi_path, qea_path) ⇒ Object



140
141
142
# File 'lib/lutaml/cli/uml_commands.rb', line 140

def verify(xmi_path, qea_path)
  Uml::VerifyCommand.new(options.to_h).run(xmi_path, qea_path)
end