Module: VagrantWindows::Helper
- Extended by:
- Helper
- Included in:
- VagrantPlugins::Chef::Provisioner::ChefClient, VagrantPlugins::Chef::Provisioner::ChefSolo, VagrantPlugins::ProviderVirtualBox::Action::ShareFolders, VagrantPlugins::ProviderVirtualBox::SyncedFolder, VagrantPlugins::Puppet::Provisioner::Puppet, VagrantPlugins::Shell::Provisioner, Helper, Provisioners::ChefCommandBuilder
- Defined in:
- lib/vagrant-windows/helper.rb
Constant Summary collapse
- @@logger =
Log4r::Logger.new("vagrant_windows::helper")
Instance Method Summary collapse
-
#wait_if_rebooting(windows_machine, wait_in_seconds = 10) ⇒ Object
Check to see if the guest is rebooting, if its rebooting then wait until its ready.
-
#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
#wait_if_rebooting(windows_machine, wait_in_seconds = 10) ⇒ Object
Check to see if the guest is rebooting, if its rebooting then wait until its ready
31 32 33 34 35 36 37 |
# File 'lib/vagrant-windows/helper.rb', line 31 def wait_if_rebooting(windows_machine, wait_in_seconds=10) @@logger.info('Checking guest reboot status') while windows_machine.is_rebooting? @@logger.debug('Guest is rebooting, waiting 10 seconds...') sleep(wait_in_seconds) end end |
#win_friendly_path(path) ⇒ String
Makes a path Windows guest friendly. Turns ‘/vagrant’ into ‘c:vagrant’
11 12 13 14 15 16 17 |
# File 'lib/vagrant-windows/helper.rb', line 11 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’
23 24 25 |
# File 'lib/vagrant-windows/helper.rb', line 23 def win_friendly_share_id(shared_folder_name) return shared_folder_name.gsub(/[\/\/]/,'_').sub(/^_/, '') end |