Class: Ea::Cli::App

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

Constant Summary collapse

OUTPUT_OPTION =

Shared kwargs for any command that writes to a file. Keeping the short-form alias in one place makes the CLI surface consistent and the convention a single source of truth: changing -o everywhere is a one-line edit, not a per-command search, and every output-bearing command honours the same flag.

{ type: :string, aliases: :o }.freeze
CONFIG_OPTION =

Shared kwargs for any command that accepts a YAML config file. Matches the OUTPUT_OPTION pattern so adding config-file support to another command is a one-line addition.

{ type: :string, aliases: :c }.freeze

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.exit_on_failure?Boolean

Returns:

  • (Boolean)


21
22
23
# File 'lib/ea/cli/app.rb', line 21

def exit_on_failure?
  true
end

Instance Method Details

#convert(file) ⇒ Object



73
74
75
# File 'lib/ea/cli/app.rb', line 73

def convert(file)
  Command::Convert.new(file: file, **symbolize(options)).call
end

#diagrams(action, file = nil, name = nil) ⇒ Object



44
45
46
47
48
# File 'lib/ea/cli/app.rb', line 44

def diagrams(action, file = nil, name = nil)
  Command::Diagrams
    .new(action: action, file: file, name: name, **symbolize(options))
    .call
end

#list(file) ⇒ Object



36
37
38
# File 'lib/ea/cli/app.rb', line 36

def list(file)
  Command::List.new(file: file, **symbolize(options)).call
end

#parse(file) ⇒ Object



65
66
67
# File 'lib/ea/cli/app.rb', line 65

def parse(file)
  Command::Parse.new(file: file, **symbolize(options)).call
end

#spa(file) ⇒ Object



85
86
87
# File 'lib/ea/cli/app.rb', line 85

def spa(file)
  Command::Spa.new(file: file, **symbolize(options)).call
end

#stats(file) ⇒ Object



58
59
60
# File 'lib/ea/cli/app.rb', line 58

def stats(file)
  Command::Stats.new(file: file, **symbolize(options)).call
end

#validate(file) ⇒ Object



52
53
54
# File 'lib/ea/cli/app.rb', line 52

def validate(file)
  Command::Validate.new(file: file, **symbolize(options)).call
end

#versionObject



27
28
29
# File 'lib/ea/cli/app.rb', line 27

def version
  puts Ea::VERSION
end