Module: VagrantWindows::Helper
- Extended by:
- Helper
- Included in:
- VagrantPlugins::Chef::Provisioner::ChefSolo, VagrantPlugins::ProviderVirtualBox::Action::ShareFolders, VagrantPlugins::Shell::Provisioner, Helper
- Defined in:
- lib/vagrant-windows/helper.rb
Instance Method Summary collapse
-
#is_vmware(machine) ⇒ Boolean
Checks to see if the specified machine is using VMWare Fusion or Workstation.
-
#win_friendly_path(path) ⇒ String
Makes a path Windows guest friendly.
-
#win_friendly_share_id(shared_folder_name) ⇒ String
Makes Vagrant share names Windows guest friendly.
Instance Method Details
#is_vmware(machine) ⇒ Boolean
Checks to see if the specified machine is using VMWare Fusion or Workstation.
28 29 30 |
# File 'lib/vagrant-windows/helper.rb', line 28 def is_vmware(machine) machine.provider_name.to_s().start_with?('vmware') end |
#win_friendly_path(path) ⇒ String
Makes a path Windows guest friendly. Turns ‘/vagrant’ into ‘c:vagrant’
9 10 11 12 13 14 15 |
# File 'lib/vagrant-windows/helper.rb', line 9 def win_friendly_path(path) if path new_path = path.gsub('/', '\\') new_path = "c:#{new_path}" if new_path =~ /^\\/ end new_path end |
#win_friendly_share_id(shared_folder_name) ⇒ String
Makes Vagrant share names Windows guest friendly. Turns ‘/vagrant’ into ‘vagrant’ or turns ”/a/b/c/d/e’ into ‘a_b_c_d_e’
21 22 23 |
# File 'lib/vagrant-windows/helper.rb', line 21 def win_friendly_share_id(shared_folder_name) return shared_folder_name.gsub(/[\/\/]/,'_').sub(/^_/, '') end |