Class: Sshez::Exec
Overview
handles all the ssh commands and updates to the .ssh/config file
Constant Summary collapse
- FILE_PATH =
File.('~') + '/.ssh/config'
- PRINTER =
PrintingManager.instance
Instance Attribute Summary collapse
-
#listener ⇒ Object
readonly
to create an instance pass any
Struct(listener) that handles the following methods * :argument_error(Command) * :done_with_no_guarantee * :permission_error * :finished_successfully.
Instance Method Summary collapse
-
#initialize(listener) ⇒ Exec
constructor
Must have the methods mentioned above.
-
#start_exec(command, options) ⇒ Object
Starts the execution of the
Commandparsed with its options.
Constructor Details
#initialize(listener) ⇒ Exec
Must have the methods mentioned above
25 26 27 |
# File 'lib/sshez/exec.rb', line 25 def initialize(listener) @listener = listener end |
Instance Attribute Details
#listener ⇒ Object (readonly)
to create an instance pass any Struct(listener) that handles the following methods
-
:argument_error(
Command) -
:done_with_no_guarantee
-
:permission_error
-
:finished_successfully
17 18 19 |
# File 'lib/sshez/exec.rb', line 17 def listener @listener end |
Instance Method Details
#start_exec(command, options) ⇒ Object
Starts the execution of the Command parsed with its options
32 33 34 35 36 |
# File 'lib/sshez/exec.rb', line 32 def start_exec(command, ) all_args = command.args all_args << self.send(command.name, *all_args) end |