Class: VagrantPlugins::ProviderVirtualBox::Action::ShareFolders

Inherits:
Object
  • Object
show all
Includes:
VagrantWindows::Helper
Defined in:
lib/vagrant-windows/monkey_patches/plugins/providers/virtualbox/action/share_folders.rb

Instance Method Summary collapse

Methods included from VagrantWindows::Helper

#wait_if_rebooting, #win_friendly_path, #win_friendly_share_id

Instance Method Details

#create_metadataObject



12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
# File 'lib/vagrant-windows/monkey_patches/plugins/providers/virtualbox/action/share_folders.rb', line 12

def 

  unless @env[:machine].is_windows?
    # don't change the shared folder name for linux guests.  We don't want the shared folder name of linux guests to be different
    # depending on whether the vagrant-windows plugin is installed or not.
    
  else
    @env[:ui].info I18n.t("vagrant.actions.vm.share_folders.creating")

    folders = []
    shared_folders.each do |id, data|
      hostpath = File.expand_path(data[:hostpath], @env[:root_path])
      hostpath = Vagrant::Util::Platform.cygwin_windows_path(hostpath)

      folder_name = win_friendly_share_id(id.gsub(/[\/\/]/,'_').sub(/^_/, ''))

      folders << {
          :name => folder_name,
          :hostpath => hostpath,
          :transient => data[:transient]
      }
    end

    @env[:machine].provider.driver.share_folders(folders)
  end
end

#original_create_metadataObject



10
# File 'lib/vagrant-windows/monkey_patches/plugins/providers/virtualbox/action/share_folders.rb', line 10

alias_method :original_create_metadata, :create_metadata