Class: VagrantPlugins::Unison::SshCommand

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

Instance Method Summary collapse

Constructor Details

#initialize(machine) ⇒ SshCommand

Returns a new instance of SshCommand.



4
5
6
# File 'lib/vagrant-unison2/ssh_command.rb', line 4

def initialize(machine)
  @machine = machine
end

Instance Method Details

#sshObject



8
9
10
11
12
13
14
# File 'lib/vagrant-unison2/ssh_command.rb', line 8

def ssh
  %W(
    ssh
    #{@machine.config.unison.ssh_user}@#{@machine.config.unison.ssh_host}
    #{ssh_args}
  ).compact.join(' ')
end

#ssh_argsObject



16
17
18
19
20
21
22
23
24
# File 'lib/vagrant-unison2/ssh_command.rb', line 16

def ssh_args
  %W(
    -p #{@machine.config.unison.ssh_port}
    #{proxy_command}
    -o StrictHostKeyChecking=no
    -o UserKnownHostsFile=/dev/null
    #{identity}
  ).compact.join(' ')
end

#uri(unison_paths) ⇒ Object



26
27
28
29
30
31
# File 'lib/vagrant-unison2/ssh_command.rb', line 26

def uri(unison_paths)
  username = @machine.config.unison.ssh_user
  host = @machine.config.unison.ssh_host

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