Class: Sshez::Runner
- Inherits:
-
Object
- Object
- Sshez::Runner
- Defined in:
- lib/sshez/runner.rb
Overview
Our main class This will #process the command of the user
Sshez::Runner.new.process(ARGV)
Acts as the listener that the Exec needs
-
:argument_error(
Command) -
:done_with_no_guarantee
-
:permission_error
-
:finished_successfully
Constant Summary collapse
- PRINTER =
PrintingManager.instance
Instance Method Summary collapse
-
#argument_error(command) ⇒ Object
Returns the appropriate error messages to the given command.
-
#done_with_no_guarantee ⇒ Object
When no valid command was supplied (maybe only an option).
-
#finished_successfully ⇒ Object
We’ve finished everything successfully.
-
#permission_error ⇒ Object
Handles when the config file could not be accessed due to a problem in permissions.
-
#process(args) ⇒ Object
Main method of the application takes un processed ARGS and pass it to our parser to start our processing.
Instance Method Details
#argument_error(command) ⇒ Object
Returns the appropriate error messages to the given command
46 47 48 |
# File 'lib/sshez/runner.rb', line 46 def argument_error(command) PRINTER.print(command.error) end |
#done_with_no_guarantee ⇒ Object
When no valid command was supplied (maybe only an option)
53 54 55 56 57 |
# File 'lib/sshez/runner.rb', line 53 def done_with_no_guarantee unless PRINTER.output? PRINTER.print('Invalid input. Use -h for help') end end |
#finished_successfully ⇒ Object
We’ve finished everything successfully
32 33 34 |
# File 'lib/sshez/runner.rb', line 32 def finished_successfully PRINTER.print 'Terminated Successfully!' end |
#permission_error ⇒ Object
Handles when the config file could not be accessed due to a problem in permissions
39 40 41 |
# File 'lib/sshez/runner.rb', line 39 def PRINTER.print "Premission denied!\nPlease check your ~/.ssh/config permissions then try again." end |