Class: VagrantPlugins::Unison::SshCommand

Inherits:
Object
  • Object
show all
Defined in:
lib/vagrant-unison-morroni/ssh_command.rb

Instance Method Summary collapse

Constructor Details

#initialize(machine, unison_paths) ⇒ SshCommand

Returns a new instance of SshCommand.



4
5
6
7
# File 'lib/vagrant-unison-morroni/ssh_command.rb', line 4

def initialize(machine, unison_paths)
  @machine = machine
  @unison_paths = unison_paths
end

Instance Method Details

#commandObject



9
10
11
12
13
14
15
16
17
# File 'lib/vagrant-unison-morroni/ssh_command.rb', line 9

def command
  %W(
    -p #{ssh_info[:port]}
    #{proxy_command}
    -o StrictHostKeyChecking=no
    -o UserKnownHostsFile=/dev/null
    #{key_paths}
  ).compact.join(' ')
end

#uriObject



19
20
21
22
23
24
# File 'lib/vagrant-unison-morroni/ssh_command.rb', line 19

def uri
  username = ssh_info[:username]
  host = ssh_info[:host]

  "ssh://#{username}@#{host}/#{@unison_paths.guest}"
end