Class: Pcli::Services::Commander
- Inherits:
-
Object
- Object
- Pcli::Services::Commander
- Defined in:
- lib/pcli/services/commander.rb
Instance Method Summary collapse
-
#initialize(**args) ⇒ Commander
constructor
A new instance of Commander.
- #run(cmd) ⇒ Object
Constructor Details
#initialize(**args) ⇒ Commander
27 28 29 30 31 |
# File 'lib/pcli/services/commander.rb', line 27 def initialize(**args) super @cli = Dry::CLI.new(commands.registry) end |
Instance Method Details
#run(cmd) ⇒ Object
33 34 35 |
# File 'lib/pcli/services/commander.rb', line 33 def run(cmd) @cli.call(arguments: cmd.split, out: output, err: output) end |