Class: Ea::Cli::App
- Inherits:
-
Thor
- Object
- Thor
- Ea::Cli::App
- 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
-oeverywhere 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 OUTPUT_OPTION; adding config support to a command is a one-line addition.
{ type: :string, aliases: :c }.freeze
Class Method Summary collapse
Instance Method Summary collapse
- #convert(file) ⇒ Object
- #diagrams(action, file = nil, name = nil) ⇒ Object
- #diff(old, new) ⇒ Object
- #export(sub, file) ⇒ Object
- #info(name, file) ⇒ Object
- #lint(file) ⇒ Object
- #list(file) ⇒ Object
- #mdg(action, arg = nil) ⇒ Object
- #parse(file) ⇒ Object
- #query(file) ⇒ Object
- #render(name = nil, file = nil) ⇒ Object
- #spa(file) ⇒ Object
- #stats(file) ⇒ Object
- #svg(name = nil, file = nil) ⇒ Object
- #validate(file) ⇒ Object
- #version ⇒ Object
Class Method Details
.exit_on_failure? ⇒ 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()).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()) .call end |
#diff(old, new) ⇒ Object
103 104 105 |
# File 'lib/ea/cli/app.rb', line 103 def diff(old, new) Command::Diff.new(old: old, new: new, **symbolize()).call end |
#export(sub, file) ⇒ Object
123 124 125 |
# File 'lib/ea/cli/app.rb', line 123 def export(sub, file) Command::Export.new(sub: sub, file: file, **symbolize()).call end |
#info(name, file) ⇒ Object
152 153 154 |
# File 'lib/ea/cli/app.rb', line 152 def info(name, file) Command::Info.new(name: name, file: file, **symbolize()).call end |
#lint(file) ⇒ Object
137 138 139 |
# File 'lib/ea/cli/app.rb', line 137 def lint(file) Command::Lint.new(file: file, **symbolize()).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()).call end |
#mdg(action, arg = nil) ⇒ Object
129 130 131 |
# File 'lib/ea/cli/app.rb', line 129 def mdg(action, arg = nil) Command::Mdg.new(action: action, arg: arg, **symbolize()).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()).call end |
#query(file) ⇒ Object
146 147 148 |
# File 'lib/ea/cli/app.rb', line 146 def query(file) Command::Query.new(file: file, **symbolize()).call end |
#render(name = nil, file = nil) ⇒ Object
116 117 118 |
# File 'lib/ea/cli/app.rb', line 116 def render(name = nil, file = nil) Command::Render.new(name: name, file: file, **symbolize()).call end |
#spa(file) ⇒ Object
84 85 86 |
# File 'lib/ea/cli/app.rb', line 84 def spa(file) Command::Spa.new(file: file, **symbolize()).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()).call end |
#svg(name = nil, file = nil) ⇒ Object
95 96 97 |
# File 'lib/ea/cli/app.rb', line 95 def svg(name = nil, file = nil) Command::Svg.new(name: name, file: file, **symbolize()).call end |