Class: Vagrant::Plugin::V2::SyncedFolder
- Inherits:
-
Object
- Object
- Vagrant::Plugin::V2::SyncedFolder
- Includes:
- CapabilityHost
- Defined in:
- lib/vagrant/plugin/v2/synced_folder.rb
Overview
This is the base class for a synced folder implementation.
Direct Known Subclasses
Defined Under Namespace
Classes: Collection
Instance Method Summary collapse
- #_initialize(machine, synced_folder_type) ⇒ Object
-
#cleanup(machine, opts) ⇒ Object
This is called after destroying the machine during a
vagrant destroy
and also prior to syncing folders during avagrant up
. -
#disable(machine, folders, opts) ⇒ Object
This is called to remove the synced folders from a running machine.
-
#enable(machine, folders, opts) ⇒ Object
This is called after the machine is booted and after networks are setup.
- #prepare(machine, folders, opts) ⇒ Object deprecated Deprecated.
-
#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.
Methods included from CapabilityHost
#capability, #capability?, #capability_host_chain, #initialize_capabilities!
Instance Method Details
#_initialize(machine, synced_folder_type) ⇒ Object
106 107 108 109 110 111 |
# File 'lib/vagrant/plugin/v2/synced_folder.rb', line 106 def _initialize(machine, synced_folder_type) plugins = Vagrant.plugin("2").manager.synced_folders capabilities = Vagrant.plugin("2").manager.synced_folder_capabilities initialize_capabilities!(synced_folder_type, plugins, capabilities, machine) self end |
#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.
103 104 |
# File 'lib/vagrant/plugin/v2/synced_folder.rb', line 103 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.
92 93 |
# File 'lib/vagrant/plugin/v2/synced_folder.rb', line 92 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.
79 80 |
# File 'lib/vagrant/plugin/v2/synced_folder.rb', line 79 def enable(machine, folders, opts) end |
#prepare(machine, folders, opts) ⇒ Object
DEPRECATED: This will be removed.
68 69 |
# File 'lib/vagrant/plugin/v2/synced_folder.rb', line 68 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.
62 63 |
# File 'lib/vagrant/plugin/v2/synced_folder.rb', line 62 def usable?(machine, raise_error=false) end |