class Taketo::Actions::Login

Public Instance Methods

run() click to toggle source
# File lib/taketo/actions/login.rb, line 9
def run
  server = ServerResolver.new(config, destination_path).resolve
  server_command = remote_command(server)
  command_to_execute = Commands[server.ssh_command].new(server).render(server_command.render(server, options))
  execute(command_to_execute)
end

Private Instance Methods

execute(shell_command) click to toggle source
# File lib/taketo/actions/login.rb, line 27
def execute(shell_command)
  if options[:dry_run]
    puts shell_command
  else
    system shell_command
  end
end
remote_command(server) click to toggle source
# File lib/taketo/actions/login.rb, line 18
def remote_command(server)
  command = options[:command]
  if String(command).empty?
    server.default_command
  else
    server.find_command(command.to_sym) || Constructs::Command.explicit_command(command)
  end
end