Class: CobraCommander::CLI
- Inherits:
-
Thor
- Object
- Thor
- CobraCommander::CLI
- Defined in:
- lib/cobra_commander/cli.rb
Overview
Implements the tool’s CLI
Instance Method Summary collapse
- #changes ⇒ Object
- #exec(command_or_component, command = nil) ⇒ Object
- #graph(component = nil) ⇒ Object
- #ls(component = nil) ⇒ Object
- #tree(component = nil) ⇒ Object
- #version ⇒ Object
Instance Method Details
#changes ⇒ Object
68 69 70 |
# File 'lib/cobra_commander/cli.rb', line 68 def changes Change.new(umbrella, .results, .branch).run! end |
#exec(command_or_component, command = nil) ⇒ Object
39 40 41 42 43 44 |
# File 'lib/cobra_commander/cli.rb', line 39 def exec(command_or_component, command = nil) CobraCommander::Executor.exec( components_filtered(command && command_or_component), command ? command : command_or_component ) end |
#graph(component = nil) ⇒ Object
55 56 57 58 59 60 61 62 63 |
# File 'lib/cobra_commander/cli.rb', line 55 def graph(component = nil) CobraCommander::Output::GraphViz.generate( find_component(component), .output ) puts "Graph generated at #{options.output}" rescue ArgumentError => error error error. end |
#ls(component = nil) ⇒ Object
30 31 32 33 |
# File 'lib/cobra_commander/cli.rb', line 30 def ls(component = nil) components = components_filtered(component) puts .total ? components.size : CobraCommander::Output::FlatList.new(components).to_s end |
#tree(component = nil) ⇒ Object
47 48 49 50 |
# File 'lib/cobra_commander/cli.rb', line 47 def tree(component = nil) component = find_component(component) puts CobraCommander::Output::AsciiTree.new(component).to_s end |
#version ⇒ Object
20 21 22 |
# File 'lib/cobra_commander/cli.rb', line 20 def version puts CobraCommander::VERSION end |