Module: VagrantPlugins::HostManager::HostsFile::Updater::WindowsSupport
- Defined in:
- lib/vagrant-hostmanager/hosts_file/updater.rb
Overview
Windows support for copying files, requesting elevated privileges if necessary
Class Method Summary collapse
Instance Method Summary collapse
Class Method Details
.windows? ⇒ Boolean
169 170 171 |
# File 'lib/vagrant-hostmanager/hosts_file/updater.rb', line 169 def self.windows? RbConfig::CONFIG['host_os'] =~ /mswin|mingw|cygwin/ end |
Instance Method Details
#windows_copy_file(source, dest) ⇒ Object
175 176 177 178 179 180 181 182 183 |
# File 'lib/vagrant-hostmanager/hosts_file/updater.rb', line 175 def windows_copy_file(source, dest) begin # First, try Ruby copy FileUtils.cp(source, dest) rescue Errno::EACCES # Access denied, try with elevated privileges windows_copy_file_elevated(source, dest) end end |