Class: Vagrant::Plugin::V2::SyncedFolder

Inherits:
Object
  • Object
show all
Defined in:
lib/vagrant/plugin/v2/synced_folder.rb

Overview

This is the base class for a synced folder implementation.

Instance Method Summary collapse

Instance Method Details

#cleanup(machine, opts) ⇒ Object

This is called after destroying the machine during a vagrant destroy and also prior to syncing folders during a vagrant up.

No return value.

Parameters:



55
56
# File 'lib/vagrant/plugin/v2/synced_folder.rb', line 55

def cleanup(machine, opts)
end

#disable(machine, folders, opts) ⇒ Object

This is called to remove the synced folders from a running machine.

This is not guaranteed to be called, but this should be implemented by every synced folder implementation.

Parameters:

  • machine (Machine)

    The machine to modify.

  • folders (Hash)

    The folders to remove. This will not contain any folders that should remain.

  • opts (Hash)

    Any options for the synced folders.



44
45
# File 'lib/vagrant/plugin/v2/synced_folder.rb', line 44

def disable(machine, folders, opts)
end

#enable(machine, folders, opts) ⇒ Object

This is called after the machine is booted and after networks are setup.

This might be called with new folders while the machine is running. If so, then this should add only those folders without removing any existing ones.

No return value.



31
32
# File 'lib/vagrant/plugin/v2/synced_folder.rb', line 31

def enable(machine, folders, opts)
end

#prepare(machine, folders, opts) ⇒ Object

Deprecated.

DEPRECATED: This will be removed.



20
21
# File 'lib/vagrant/plugin/v2/synced_folder.rb', line 20

def prepare(machine, folders, opts)
end

#usable?(machine, raise_error = false) ⇒ Boolean

This is called early when the synced folder is set to determine if this implementation can be used for this machine. This should return true or false.

Parameters:

  • machine (Machine)
  • raise_error (Boolean) (defaults to: false)

    If true, should raise an exception if it isn't usable.

Returns:

  • (Boolean)


14
15
# File 'lib/vagrant/plugin/v2/synced_folder.rb', line 14

def usable?(machine, raise_error=false)
end