Module: VagrantPlugins::HostManager::HostsFile::Updater::WindowsSupport
- Defined in:
- lib/vagrant-hostmanager-rethinc/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
184 185 186 |
# File 'lib/vagrant-hostmanager-rethinc/hosts_file/updater.rb', line 184 def self.windows? RbConfig::CONFIG['host_os'] =~ /mswin|mingw|cygwin/ end |
Instance Method Details
#windows_copy_file(source, dest) ⇒ Object
190 191 192 193 194 195 196 197 198 |
# File 'lib/vagrant-hostmanager-rethinc/hosts_file/updater.rb', line 190 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 |