Class: VagrantPlugins::AVF::SharedDirectories
- Inherits:
-
Object
- Object
- VagrantPlugins::AVF::SharedDirectories
- Defined in:
- lib/vagrant_provider_avf/shared_directories.rb
Constant Summary collapse
- SYNCED_FOLDER_TYPE =
:avf_virtiofs
Class Method Summary collapse
- .expand_host_path(root_path, host_path) ⇒ Object
- .for(machine) ⇒ Object
- .supported_type?(type) ⇒ Boolean
Class Method Details
.expand_host_path(root_path, host_path) ⇒ Object
25 26 27 28 29 30 |
# File 'lib/vagrant_provider_avf/shared_directories.rb', line 25 def self.(root_path, host_path) = File.(host_path, root_path.to_s) return File.realpath() if File.directory?() end |
.for(machine) ⇒ Object
6 7 8 9 10 11 12 13 14 15 16 17 |
# File 'lib/vagrant_provider_avf/shared_directories.rb', line 6 def self.for(machine) machine.config.vm.synced_folders.each_with_object([]) do |(id, data), shared_directories| next if data[:disabled] next unless supported_type?(data[:type]) shared_directories << Model::SharedDirectory.new( id: id, host_path: (machine.env.root_path, data[:hostpath]), guest_path: data[:guestpath] ) end end |
.supported_type?(type) ⇒ Boolean
19 20 21 22 23 |
# File 'lib/vagrant_provider_avf/shared_directories.rb', line 19 def self.supported_type?(type) return true if type.nil? || type.to_s.empty? type.to_sym == SYNCED_FOLDER_TYPE end |