Class: VagrantPlugins::Unison::UnisonPaths

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

Instance Method Summary collapse

Constructor Details

#initialize(env, machine) ⇒ UnisonPaths

Returns a new instance of UnisonPaths.



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

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

Instance Method Details

#guestObject



9
10
11
# File 'lib/vagrant-unison2/unison_paths.rb', line 9

def guest
  @machine.config.unison.guest_folder
end

#hostObject



13
14
15
16
17
18
19
20
21
# File 'lib/vagrant-unison2/unison_paths.rb', line 13

def host
  @host ||= begin
    path = File.expand_path(@machine.config.unison.host_folder, @env.root_path)

    # Make sure there is a trailing slash on the host path to
    # avoid creating an additional directory with rsync
    path = "#{path}/" if path !~ /\/$/
  end
end