Class: VagrantWindows::Guest::Windows
- Inherits:
-
Object
- Object
- VagrantWindows::Guest::Windows
- Defined in:
- lib/vagrant-windows/guest/windows.rb
Instance Attribute Summary collapse
-
#machine ⇒ Object
readonly
Returns the value of attribute machine.
-
#windows_machine ⇒ Object
readonly
Vagrant 1.1.x compatibility methods Implement the 1.1.x methods and call through to the new 1.2.x capabilities.
Instance Method Summary collapse
- #change_host_name(name) ⇒ Object
- #configure_networks(networks) ⇒ Object
-
#detect?(machine) ⇒ Boolean
Vagrant 1.2.x compatibility methods.
- #distro_dispatch ⇒ Object
- #halt ⇒ Object
-
#initialize(machine = nil) ⇒ Windows
constructor
A new instance of Windows.
- #mount_shared_folder(name, guestpath, options) ⇒ Object
Constructor Details
#initialize(machine = nil) ⇒ Windows
Returns a new instance of Windows.
18 19 20 21 22 |
# File 'lib/vagrant-windows/guest/windows.rb', line 18 def initialize(machine = nil) super(machine) unless machine == nil @machine = machine @windows_machine = ::VagrantWindows::WindowsMachine.new(machine) end |
Instance Attribute Details
#machine ⇒ Object (readonly)
Returns the value of attribute machine.
16 17 18 |
# File 'lib/vagrant-windows/guest/windows.rb', line 16 def machine @machine end |
#windows_machine ⇒ Object (readonly)
Vagrant 1.1.x compatibility methods Implement the 1.1.x methods and call through to the new 1.2.x capabilities
15 16 17 |
# File 'lib/vagrant-windows/guest/windows.rb', line 15 def windows_machine @windows_machine end |
Instance Method Details
#change_host_name(name) ⇒ Object
24 25 26 |
# File 'lib/vagrant-windows/guest/windows.rb', line 24 def change_host_name(name) VagrantWindows::Guest::Cap::ChangeHostName.change_host_name(@machine, name) end |
#configure_networks(networks) ⇒ Object
49 50 51 |
# File 'lib/vagrant-windows/guest/windows.rb', line 49 def configure_networks(networks) VagrantWindows::Guest::Cap::ConfigureNetworks.configure_networks(@machine, networks) end |
#detect?(machine) ⇒ Boolean
Vagrant 1.2.x compatibility methods
56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 |
# File 'lib/vagrant-windows/guest/windows.rb', line 56 def detect?(machine) # uname -o | grep Solaris # uname -s | grep 'Linux' # uname -s | grep 'FreeBSD' # cat /etc/redhat-release # uname -s | grep 'OpenBSD' # cat /etc/gentoo-release # cat /proc/version | grep 'Debian' # cat /etc/arch-release # cat /proc/version | grep 'Ubuntu' # cat /etc/SuSE-release # cat /etc/pld-release # grep 'Fedora release 1[678]' /etc/redhat-release # see if the Windows directory is present machine.communicate.test("test -d $Env:SystemRoot") end |
#distro_dispatch ⇒ Object
28 29 30 |
# File 'lib/vagrant-windows/guest/windows.rb', line 28 def distro_dispatch :windows end |
#halt ⇒ Object
32 33 34 |
# File 'lib/vagrant-windows/guest/windows.rb', line 32 def halt VagrantWindows::Guest::Cap::Halt.halt(@machine) end |
#mount_shared_folder(name, guestpath, options) ⇒ Object
36 37 38 39 40 41 42 43 44 45 46 47 |
# File 'lib/vagrant-windows/guest/windows.rb', line 36 def mount_shared_folder(name, guestpath, ) if @windows_machine.is_vmware? VagrantWindows::Guest::Cap::MountSharedFolder.mount_vmware_shared_folder( @machine, name, guestpath, ) elsif @windows_machine.is_parallels? VagrantWindows::Guest::Cap::MountSharedFolder.mount_parallels_shared_folder( @machine, name, guestpath, ) else VagrantWindows::Guest::Cap::MountSharedFolder.mount_virtualbox_shared_folder( @machine, name, guestpath, ) end end |