Class: SshKeySwitcher::Options::Ping

Inherits:
Object
  • Object
show all
Extended by:
Contains, Utils
Defined in:
lib/ssh_key_switcher/options/ping.rb

Constant Summary

Constants included from Contains

Contains::SERVER_NAMES, Contains::SSH_DIR, Contains::STRING_DETECT_OPENSSH_KEY

Class Method Summary collapse

Class Method Details

.pongObject



7
8
9
10
11
# File 'lib/ssh_key_switcher/options/ping.rb', line 7

def pong
  server_names = SERVER_NAMES.map { |server| "git@#{server}" }
  result = prompt.select('Connect to', server_names, default: '[email protected]')
  Cmd.exec("ssh -T #{result}", print: true)
end