Class: VagrantPlugins::SyncedFolderSSHFS::SyncedFolder
- Inherits:
-
Object
- Object
- VagrantPlugins::SyncedFolderSSHFS::SyncedFolder
- Defined in:
- lib/vagrant-sshfs/synced_folder.rb,
lib/vagrant-sshfs/synced_folder/sshfs_forward_mount.rb,
lib/vagrant-sshfs/synced_folder/sshfs_reverse_mount.rb
Instance Method Summary collapse
-
#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`.
-
#disable(machine, folders, opts) ⇒ Object
This is called to remove the synced folders from a running machine.
-
#enable(machine, folders, pluginopts) ⇒ Object
This is called after the machine is booted and after networks are setup.
-
#initialize(*args) ⇒ SyncedFolder
constructor
A new instance of SyncedFolder.
-
#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.
Constructor Details
#initialize(*args) ⇒ SyncedFolder
Returns a new instance of SyncedFolder.
13 14 15 16 17 |
# File 'lib/vagrant-sshfs/synced_folder.rb', line 13 def initialize(*args) super @logger = Log4r::Logger.new("vagrant::synced_folders::sshfs") end |
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.
82 83 |
# File 'lib/vagrant-sshfs/synced_folder.rb', line 82 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.
62 63 64 65 66 67 68 69 70 71 72 |
# File 'lib/vagrant-sshfs/synced_folder.rb', line 62 def disable(machine, folders, opts) # Iterate through the folders and mount if needed folders.each do |id, opts| if opts.has_key?(:reverse) and opts[:reverse] do_reverse_unmount(machine, opts) else do_forward_unmount(machine, opts) end end end |
#enable(machine, folders, pluginopts) ⇒ 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.
39 40 41 42 43 44 45 46 47 48 49 50 |
# File 'lib/vagrant-sshfs/synced_folder.rb', line 39 def enable(machine, folders, pluginopts) # Iterate through the folders and mount if needed folders.each do |id, opts| if opts.has_key?(:reverse) and opts[:reverse] do_reverse_mount(machine, opts) else do_forward_mount(machine, opts) end end 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.
27 28 29 |
# File 'lib/vagrant-sshfs/synced_folder.rb', line 27 def usable?(machine, raise_error=false) return true #for now end |