Module: Taketo::Commands::SSHOptions

Includes:
Shellwords
Included in:
MoshCommand, SSHCommand
Defined in:
lib/taketo/commands/ssh_options.rb

Instance Method Summary collapse

Instance Method Details

#hostObject



13
14
15
# File 'lib/taketo/commands/ssh_options.rb', line 13

def host
  shellescape @server.host
end

#identity_fileObject



25
26
27
# File 'lib/taketo/commands/ssh_options.rb', line 25

def identity_file
  %Q[-i #{shellescape @server.identity_file}] if @server.identity_file
end

#initialize(server) ⇒ Object



9
10
11
# File 'lib/taketo/commands/ssh_options.rb', line 9

def initialize(server)
  @server = server
end

#portObject



17
18
19
# File 'lib/taketo/commands/ssh_options.rb', line 17

def port
  %Q[-p #{@server.port}] if @server.port
end

#usernameObject



21
22
23
# File 'lib/taketo/commands/ssh_options.rb', line 21

def username
  %Q[#{shellescape @server.username}@] if @server.username
end