class Sshez::Runner

Our main class This will process the command of the user

Sshez::Runner.new.process(ARGV)

Acts as the listener that the Exec needs

Constants

PRINTER

Public Instance Methods

argument_error(command) click to toggle source

Returns the appropriate error messages to the given command

# File lib/sshez/runner.rb, line 46
def argument_error(command)
  PRINTER.print(command.error)
end
done_with_no_guarantee() click to toggle source

When no valid command was supplied (maybe only an option)

# 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() click to toggle source

We've finished everything successfully

# File lib/sshez/runner.rb, line 32
def finished_successfully
  PRINTER.print 'Terminated Successfully!'
end
permission_error() click to toggle source

Handles when the config file could not be accessed due to a problem in permissions

# File lib/sshez/runner.rb, line 39
def permission_error
  PRINTER.print "Premission denied!\nPlease check your ~/.ssh/config permissions then try again."
end
process(args) click to toggle source

Main method of the application takes un processed ARGS and pass it to our parser to start our processing

# File lib/sshez/runner.rb, line 23
def process(args)
  parser = Parser.new(Exec.new(self))
  parser.parse(args)
  PRINTER.output
end