virtualbox 0.8.6 → 0.9.0
Sign up to get free protection for your applications and to get access to all the features.
- data/Rakefile +11 -5
- data/TODO.md +7 -0
- data/lib/virtualbox.rb +34 -8
- data/lib/virtualbox/abstract_model.rb +7 -8
- data/lib/virtualbox/abstract_model/attributable.rb +16 -2
- data/lib/virtualbox/abstract_model/interface_attributes.rb +10 -1
- data/lib/virtualbox/abstract_model/relatable.rb +11 -0
- data/lib/virtualbox/appliance.rb +1 -1
- data/lib/virtualbox/com.rb +13 -12
- data/lib/virtualbox/com/abstract_enum.rb +21 -5
- data/lib/virtualbox/com/abstract_interface.rb +11 -0
- data/lib/virtualbox/com/base_interface.rb +1 -32
- data/lib/virtualbox/com/{ffi/vboxxpcomc.rb → ffi.rb} +7 -0
- data/lib/virtualbox/com/ffi/interface.rb +10 -27
- data/lib/virtualbox/com/ffi/util.rb +32 -2
- data/lib/virtualbox/com/ffi_interface.rb +8 -2
- data/lib/virtualbox/com/implementer.rb +10 -0
- data/lib/virtualbox/com/implementer/base.rb +10 -3
- data/lib/virtualbox/com/implementer/ffi.rb +40 -13
- data/lib/virtualbox/com/implementer/mscom.rb +18 -1
- data/lib/virtualbox/com/interface/4.0.x/{access_mode.rb → AccessMode.rb} +1 -1
- data/lib/virtualbox/com/interface/4.0.x/{appliance.rb → Appliance.rb} +0 -0
- data/lib/virtualbox/com/interface/4.0.x/{audio_adapter.rb → AudioAdapter.rb} +1 -1
- data/lib/virtualbox/com/interface/4.0.x/{audio_controller_type.rb → AudioControllerType.rb} +0 -0
- data/lib/virtualbox/com/interface/4.0.x/{audio_driver_type.rb → AudioDriverType.rb} +0 -0
- data/lib/virtualbox/com/interface/4.0.x/{auth_type.rb → AuthType.rb} +0 -0
- data/lib/virtualbox/com/interface/4.0.x/{bios_boot_menu_mode.rb → BIOSBootMenuMode.rb} +0 -0
- data/lib/virtualbox/com/interface/4.0.x/{bios_settings.rb → BIOSSettings.rb} +1 -1
- data/lib/virtualbox/com/interface/4.0.x/{bandwidth_control.rb → BandwidthControl.rb} +0 -0
- data/lib/virtualbox/com/interface/4.0.x/{bandwidth_group.rb → BandwidthGroup.rb} +0 -0
- data/lib/virtualbox/com/interface/4.0.x/{bandwidth_group_type.rb → BandwidthGroupType.rb} +0 -0
- data/lib/virtualbox/com/interface/4.0.x/{chipset_type.rb → ChipsetType.rb} +0 -0
- data/lib/virtualbox/com/interface/4.0.x/{cleanup_mode.rb → CleanupMode.rb} +0 -0
- data/lib/virtualbox/com/interface/4.0.x/{clipboard_mode.rb → ClipboardMode.rb} +0 -0
- data/lib/virtualbox/com/interface/4.0.x/{console.rb → Console.rb} +0 -0
- data/lib/virtualbox/com/interface/4.0.x/{cpu_property_type.rb → CpuPropertyType.rb} +0 -0
- data/lib/virtualbox/com/interface/4.0.x/{dhcp_server.rb → DHCPServer.rb} +0 -0
- data/lib/virtualbox/com/interface/4.0.x/{data_type.rb → DataType.rb} +0 -0
- data/lib/virtualbox/com/interface/4.0.x/{device_type.rb → DeviceType.rb} +0 -0
- data/lib/virtualbox/com/interface/4.0.x/{event_source.rb → EventSource.rb} +0 -0
- data/lib/virtualbox/com/interface/4.0.x/{fault_tolerance_state.rb → FaultToleranceState.rb} +0 -0
- data/lib/virtualbox/com/interface/4.0.x/{firmware_type.rb → FirmwareType.rb} +0 -0
- data/lib/virtualbox/com/interface/4.0.x/{guest.rb → Guest.rb} +0 -0
- data/lib/virtualbox/com/interface/4.0.x/{guest_os_type.rb → GuestOSType.rb} +0 -0
- data/lib/virtualbox/com/interface/4.0.x/{hw_virt_ex_property_type.rb → HWVirtExPropertyType.rb} +0 -0
- data/lib/virtualbox/com/interface/4.0.x/{host.rb → Host.rb} +6 -6
- data/lib/virtualbox/com/interface/4.0.x/{host_network_interface.rb → HostNetworkInterface.rb} +0 -0
- data/lib/virtualbox/com/interface/4.0.x/{host_network_interface_medium_type.rb → HostNetworkInterfaceMediumType.rb} +0 -0
- data/lib/virtualbox/com/interface/4.0.x/{host_network_interface_status.rb → HostNetworkInterfaceStatus.rb} +0 -0
- data/lib/virtualbox/com/interface/4.0.x/{host_network_interface_type.rb → HostNetworkInterfaceType.rb} +0 -0
- data/lib/virtualbox/com/interface/4.0.x/{host_usb_device.rb → HostUSBDevice.rb} +3 -1
- data/lib/virtualbox/com/interface/4.0.x/{host_usb_device_filter.rb → HostUSBDeviceFilter.rb} +3 -1
- data/lib/virtualbox/com/interface/4.0.x/{keyboard_hid_type.rb → KeyboardHidType.rb} +0 -0
- data/lib/virtualbox/com/interface/4.0.x/{lock_type.rb → LockType.rb} +0 -0
- data/lib/virtualbox/com/interface/4.0.x/{machine.rb → Machine.rb} +0 -0
- data/lib/virtualbox/com/interface/4.0.x/{machine_state.rb → MachineState.rb} +0 -0
- data/lib/virtualbox/com/interface/4.0.x/{medium.rb → Medium.rb} +0 -0
- data/lib/virtualbox/com/interface/4.0.x/{medium_attachment.rb → MediumAttachment.rb} +0 -0
- data/lib/virtualbox/com/interface/4.0.x/{medium_format.rb → MediumFormat.rb} +0 -0
- data/lib/virtualbox/com/interface/4.0.x/{medium_state.rb → MediumState.rb} +0 -0
- data/lib/virtualbox/com/interface/4.0.x/{medium_type.rb → MediumType.rb} +0 -0
- data/lib/virtualbox/com/interface/4.0.x/{medium_variant.rb → MediumVariant.rb} +0 -0
- data/lib/virtualbox/com/interface/4.0.x/{nat_alias_mode.rb → NATAliasMode.rb} +0 -0
- data/lib/virtualbox/com/interface/4.0.x/{nat_engine.rb → NATEngine.rb} +0 -0
- data/lib/virtualbox/com/interface/4.0.x/{nat_protocol.rb → NATProtocol.rb} +0 -0
- data/lib/virtualbox/com/interface/4.0.x/{nsiexception.rb → NSIException.rb} +0 -0
- data/lib/virtualbox/com/interface/4.0.x/{nsisupports.rb → NSISupports.rb} +3 -0
- data/lib/virtualbox/com/interface/4.0.x/{network_adapter.rb → NetworkAdapter.rb} +0 -0
- data/lib/virtualbox/com/interface/4.0.x/{network_adapter_type.rb → NetworkAdapterType.rb} +0 -0
- data/lib/virtualbox/com/interface/4.0.x/{network_attachment_type.rb → NetworkAttachmentType.rb} +0 -0
- data/lib/virtualbox/com/interface/4.0.x/{parallel_port.rb → ParallelPort.rb} +0 -0
- data/lib/virtualbox/com/interface/4.0.x/{pci_device_attachment.rb → PciDeviceAttachment.rb} +0 -0
- data/lib/virtualbox/com/interface/4.0.x/{pointing_hid_type.rb → PointingHidType.rb} +0 -0
- data/lib/virtualbox/com/interface/4.0.x/{port_mode.rb → PortMode.rb} +0 -0
- data/lib/virtualbox/com/interface/4.0.x/{progress.rb → Progress.rb} +0 -0
- data/lib/virtualbox/com/interface/4.0.x/{serial_port.rb → SerialPort.rb} +0 -0
- data/lib/virtualbox/com/interface/4.0.x/{session.rb → Session.rb} +0 -0
- data/lib/virtualbox/com/interface/4.0.x/{session_state.rb → SessionState.rb} +0 -0
- data/lib/virtualbox/com/interface/4.0.x/{session_type.rb → SessionType.rb} +0 -0
- data/lib/virtualbox/com/interface/4.0.x/{shared_folder.rb → SharedFolder.rb} +0 -0
- data/lib/virtualbox/com/interface/4.0.x/{snapshot.rb → Snapshot.rb} +0 -0
- data/lib/virtualbox/com/interface/4.0.x/{storage_bus.rb → StorageBus.rb} +0 -0
- data/lib/virtualbox/com/interface/4.0.x/{storage_controller.rb → StorageController.rb} +0 -0
- data/lib/virtualbox/com/interface/4.0.x/{storage_controller_type.rb → StorageControllerType.rb} +0 -0
- data/lib/virtualbox/com/interface/4.0.x/{system_properties.rb → SystemProperties.rb} +0 -0
- data/lib/virtualbox/com/interface/4.0.x/{usb_controller.rb → USBController.rb} +0 -0
- data/lib/virtualbox/com/interface/4.0.x/{usb_device.rb → USBDevice.rb} +0 -0
- data/lib/virtualbox/com/interface/4.0.x/{usb_device_filter.rb → USBDeviceFilter.rb} +0 -0
- data/lib/virtualbox/com/interface/4.0.x/{usb_device_filter_action.rb → USBDeviceFilterAction.rb} +0 -0
- data/lib/virtualbox/com/interface/4.0.x/{usb_device_state.rb → USBDeviceState.rb} +0 -0
- data/lib/virtualbox/com/interface/4.0.x/{vrde_server.rb → VRDEServer.rb} +0 -0
- data/lib/virtualbox/com/interface/4.0.x/{virtualbox.rb → VirtualBox.rb} +1 -1
- data/lib/virtualbox/com/interface/4.0.x/{virtual_box_error_info.rb → VirtualBoxErrorInfo.rb} +3 -1
- data/lib/virtualbox/com/interface/4.0.x/{virtual_system_description.rb → VirtualSystemDescription.rb} +0 -0
- data/lib/virtualbox/com/interface/4.0.x/{virtual_system_description_type.rb → VirtualSystemDescriptionType.rb} +0 -0
- data/lib/virtualbox/com/interface/4.0.x/{virtual_system_description_value_type.rb → VirtualSystemDescriptionValueType.rb} +0 -0
- data/lib/virtualbox/com/interface/{3.2.x/access_mode.rb → 4.1.x/AccessMode.rb} +2 -2
- data/lib/virtualbox/com/interface/4.1.x/AdditionsFacility.rb +17 -0
- data/lib/virtualbox/com/interface/4.1.x/AdditionsFacilityClass.rb +17 -0
- data/lib/virtualbox/com/interface/4.1.x/AdditionsFacilityStatus.rb +19 -0
- data/lib/virtualbox/com/interface/4.1.x/AdditionsFacilityType.rb +17 -0
- data/lib/virtualbox/com/interface/4.1.x/AdditionsRunLevelType.rb +14 -0
- data/lib/virtualbox/com/interface/{3.2.x/appliance.rb → 4.1.x/Appliance.rb} +5 -4
- data/lib/virtualbox/com/interface/{3.1.x/audio_adapter.rb → 4.1.x/AudioAdapter.rb} +2 -2
- data/lib/virtualbox/com/interface/{3.1.x/audio_controller_type.rb → 4.1.x/AudioControllerType.rb} +2 -2
- data/lib/virtualbox/com/interface/{3.2.x/audio_driver_type.rb → 4.1.x/AudioDriverType.rb} +2 -2
- data/lib/virtualbox/com/interface/{3.1.x/vrdp_auth_type.rb → 4.1.x/AuthType.rb} +3 -3
- data/lib/virtualbox/com/interface/{3.1.x/bios_boot_menu_mode.rb → 4.1.x/BIOSBootMenuMode.rb} +2 -2
- data/lib/virtualbox/com/interface/{3.2.x/bios_settings.rb → 4.1.x/BIOSSettings.rb} +2 -2
- data/lib/virtualbox/com/interface/4.1.x/BandwidthControl.rb +18 -0
- data/lib/virtualbox/com/interface/4.1.x/BandwidthGroup.rb +16 -0
- data/lib/virtualbox/com/interface/4.1.x/BandwidthGroupType.rb +11 -0
- data/lib/virtualbox/com/interface/4.1.x/ChipsetType.rb +11 -0
- data/lib/virtualbox/com/interface/4.1.x/CleanupMode.rb +12 -0
- data/lib/virtualbox/com/interface/{3.2.x/clipboard_mode.rb → 4.1.x/ClipboardMode.rb} +2 -2
- data/lib/virtualbox/com/interface/4.1.x/CloneMode.rb +13 -0
- data/lib/virtualbox/com/interface/4.1.x/CloneOptions.rb +14 -0
- data/lib/virtualbox/com/interface/{3.1.x/console.rb → 4.1.x/Console.rb} +10 -7
- data/lib/virtualbox/com/interface/{3.2.x/cpu_property_type.rb → 4.1.x/CpuPropertyType.rb} +2 -2
- data/lib/virtualbox/com/interface/{3.1.x/dhcp_server.rb → 4.1.x/DHCPServer.rb} +2 -2
- data/lib/virtualbox/com/interface/4.1.x/DataType.rb +11 -0
- data/lib/virtualbox/com/interface/{3.1.x/device_type.rb → 4.1.x/DeviceType.rb} +2 -2
- data/lib/virtualbox/com/interface/4.1.x/DirectoryCreateFlag.rb +12 -0
- data/lib/virtualbox/com/interface/4.1.x/DirectoryOpenFlag.rb +11 -0
- data/lib/virtualbox/com/interface/{3.2.x/guest.rb → 4.1.x/EventSource.rb} +4 -4
- data/lib/virtualbox/com/interface/4.1.x/ExecuteProcessFlag.rb +15 -0
- data/lib/virtualbox/com/interface/4.1.x/ExecuteProcessStatus.rb +19 -0
- data/lib/virtualbox/com/interface/4.1.x/FaultToleranceState.rb +11 -0
- data/lib/virtualbox/com/interface/{3.1.x/firmware_type.rb → 4.1.x/FirmwareType.rb} +2 -2
- data/lib/virtualbox/com/interface/4.1.x/Guest.rb +36 -0
- data/lib/virtualbox/com/interface/4.1.x/GuestDirEntry.rb +15 -0
- data/lib/virtualbox/com/interface/4.1.x/GuestDirEntryType.rb +14 -0
- data/lib/virtualbox/com/interface/{3.2.x/guest_os_type.rb → 4.1.x/GuestOSType.rb} +2 -2
- data/lib/virtualbox/com/interface/{3.1.x/hw_virt_ex_property_type.rb → 4.1.x/HWVirtExPropertyType.rb} +4 -3
- data/lib/virtualbox/com/interface/{3.1.x/host.rb → 4.1.x/Host.rb} +8 -6
- data/lib/virtualbox/com/interface/{3.1.x/host_network_interface.rb → 4.1.x/HostNetworkInterface.rb} +2 -2
- data/lib/virtualbox/com/interface/{3.1.x/host_network_interface_medium_type.rb → 4.1.x/HostNetworkInterfaceMediumType.rb} +2 -2
- data/lib/virtualbox/com/interface/{3.2.x/host_network_interface_status.rb → 4.1.x/HostNetworkInterfaceStatus.rb} +2 -2
- data/lib/virtualbox/com/interface/{3.1.x/host_network_interface_type.rb → 4.1.x/HostNetworkInterfaceType.rb} +2 -2
- data/lib/virtualbox/com/interface/{3.1.x/host_usb_device.rb → 4.1.x/HostUSBDevice.rb} +4 -2
- data/lib/virtualbox/com/interface/{3.2.x/host_usb_device_filter.rb → 4.1.x/HostUSBDeviceFilter.rb} +4 -2
- data/lib/virtualbox/com/interface/4.1.x/ImportOptions.rb +12 -0
- data/lib/virtualbox/com/interface/{3.2.x/keyboard_hid_type.rb → 4.1.x/KeyboardHidType.rb} +2 -2
- data/lib/virtualbox/com/interface/4.1.x/LockType.rb +11 -0
- data/lib/virtualbox/com/interface/{3.2.x/machine.rb → 4.1.x/Machine.rb} +34 -15
- data/lib/virtualbox/com/interface/{3.1.x/machine_state.rb → 4.1.x/MachineState.rb} +1 -1
- data/lib/virtualbox/com/interface/{3.2.x/medium.rb → 4.1.x/Medium.rb} +5 -2
- data/lib/virtualbox/com/interface/{3.1.x/medium_attachment.rb → 4.1.x/MediumAttachment.rb} +6 -2
- data/lib/virtualbox/com/interface/{3.1.x/medium_format.rb → 4.1.x/MediumFormat.rb} +2 -2
- data/lib/virtualbox/com/interface/{3.1.x/medium_state.rb → 4.1.x/MediumState.rb} +2 -2
- data/lib/virtualbox/com/interface/{3.2.x/medium_type.rb → 4.1.x/MediumType.rb} +2 -2
- data/lib/virtualbox/com/interface/{3.1.x/medium_variant.rb → 4.1.x/MediumVariant.rb} +2 -2
- data/lib/virtualbox/com/interface/{3.2.x/nat_alias_mode.rb → 4.1.x/NATAliasMode.rb} +2 -2
- data/lib/virtualbox/com/interface/{3.2.x/nat_engine.rb → 4.1.x/NATEngine.rb} +2 -2
- data/lib/virtualbox/com/interface/{3.2.x/nat_protocol.rb → 4.1.x/NATProtocol.rb} +2 -2
- data/lib/virtualbox/com/interface/{3.1.x/nsiexception.rb → 4.1.x/NSIException.rb} +2 -2
- data/lib/virtualbox/com/interface/{3.1.x/nsisupports.rb → 4.1.x/NSISupports.rb} +4 -1
- data/lib/virtualbox/com/interface/{3.2.x/network_adapter.rb → 4.1.x/NetworkAdapter.rb} +11 -11
- data/lib/virtualbox/com/interface/4.1.x/NetworkAdapterPromiscModePolicy.rb +13 -0
- data/lib/virtualbox/com/interface/{3.1.x/network_adapter_type.rb → 4.1.x/NetworkAdapterType.rb} +2 -2
- data/lib/virtualbox/com/interface/{3.1.x/network_attachment_type.rb → 4.1.x/NetworkAttachmentType.rb} +3 -3
- data/lib/virtualbox/com/interface/{3.2.x/parallel_port.rb → 4.1.x/ParallelPort.rb} +2 -2
- data/lib/virtualbox/com/interface/4.1.x/PciDeviceAttachment.rb +16 -0
- data/lib/virtualbox/com/interface/{3.2.x/pointing_hid_type.rb → 4.1.x/PointingHidType.rb} +2 -2
- data/lib/virtualbox/com/interface/{3.1.x/port_mode.rb → 4.1.x/PortMode.rb} +1 -1
- data/lib/virtualbox/com/interface/4.1.x/ProcessOutputFlag.rb +12 -0
- data/lib/virtualbox/com/interface/{3.2.x/progress.rb → 4.1.x/Progress.rb} +3 -1
- data/lib/virtualbox/com/interface/{3.1.x/serial_port.rb → 4.1.x/SerialPort.rb} +2 -2
- data/lib/virtualbox/com/interface/{3.2.x/session.rb → 4.1.x/Session.rb} +2 -2
- data/lib/virtualbox/com/interface/{3.1.x/session_state.rb → 4.1.x/SessionState.rb} +2 -2
- data/lib/virtualbox/com/interface/{3.1.x/session_type.rb → 4.1.x/SessionType.rb} +3 -3
- data/lib/virtualbox/com/interface/4.1.x/SettingsVersion.rb +25 -0
- data/lib/virtualbox/com/interface/{3.1.x/shared_folder.rb → 4.1.x/SharedFolder.rb} +2 -2
- data/lib/virtualbox/com/interface/{3.1.x/snapshot.rb → 4.1.x/Snapshot.rb} +3 -2
- data/lib/virtualbox/com/interface/{3.2.x/storage_bus.rb → 4.1.x/StorageBus.rb} +2 -2
- data/lib/virtualbox/com/interface/{3.2.x/storage_controller.rb → 4.1.x/StorageController.rb} +3 -2
- data/lib/virtualbox/com/interface/{3.2.x/storage_controller_type.rb → 4.1.x/StorageControllerType.rb} +2 -2
- data/lib/virtualbox/com/interface/4.1.x/StorageDeviceChangedEvent.rb +14 -0
- data/lib/virtualbox/com/interface/{3.2.x/system_properties.rb → 4.1.x/SystemProperties.rb} +8 -6
- data/lib/virtualbox/com/interface/{3.2.x/usb_controller.rb → 4.1.x/USBController.rb} +2 -2
- data/lib/virtualbox/com/interface/{3.1.x/usb_device.rb → 4.1.x/USBDevice.rb} +2 -2
- data/lib/virtualbox/com/interface/{3.1.x/usb_device_filter.rb → 4.1.x/USBDeviceFilter.rb} +2 -2
- data/lib/virtualbox/com/interface/{3.2.x/usb_device_filter_action.rb → 4.1.x/USBDeviceFilterAction.rb} +2 -2
- data/lib/virtualbox/com/interface/{3.2.x/usb_device_state.rb → 4.1.x/USBDeviceState.rb} +2 -2
- data/lib/virtualbox/com/interface/4.1.x/VRDEServer.rb +23 -0
- data/lib/virtualbox/com/interface/{3.2.x/virtualbox.rb → 4.1.x/VirtualBox.rb} +13 -27
- data/lib/virtualbox/com/interface/{3.2.x/virtual_box_error_info.rb → 4.1.x/VirtualBoxErrorInfo.rb} +4 -2
- data/lib/virtualbox/com/interface/{3.2.x/virtual_system_description.rb → 4.1.x/VirtualSystemDescription.rb} +2 -2
- data/lib/virtualbox/com/interface/4.1.x/VirtualSystemDescriptionType.rb +34 -0
- data/lib/virtualbox/com/interface/{3.2.x/virtual_system_description_value_type.rb → 4.1.x/VirtualSystemDescriptionValueType.rb} +1 -1
- data/lib/virtualbox/com/util.rb +30 -8
- data/lib/virtualbox/exceptions.rb +14 -13
- data/lib/virtualbox/extra_data.rb +2 -0
- data/lib/virtualbox/hard_drive.rb +1 -1
- data/lib/virtualbox/host_network_interface.rb +1 -1
- data/lib/virtualbox/lib.rb +2 -0
- data/lib/virtualbox/medium.rb +2 -0
- data/lib/virtualbox/network_adapter.rb +6 -22
- data/lib/virtualbox/proxies.rb +6 -0
- data/lib/virtualbox/system_properties.rb +0 -1
- data/lib/virtualbox/version.rb +28 -30
- data/lib/virtualbox/vm.rb +75 -55
- data/test/test_helper.rb +2 -5
- data/test/virtualbox/abstract_model/attributable_test.rb +22 -0
- data/test/virtualbox/abstract_model/relatable_test.rb +21 -0
- data/test/virtualbox/abstract_model_test.rb +1 -8
- data/test/virtualbox/com/abstract_enum_test.rb +1 -1
- data/test/virtualbox/com/ffi/interface_test.rb +9 -6
- data/test/virtualbox/com/ffi/util_test.rb +0 -11
- data/test/virtualbox/com/implementer/ffi_test.rb +7 -21
- data/test/virtualbox/com/util_test.rb +0 -10
- data/test/virtualbox/host_network_interface_test.rb +1 -1
- data/test/virtualbox/network_adapter_test.rb +6 -32
- data/test/virtualbox/version_test.rb +1 -5
- data/test/virtualbox/vm_test.rb +11 -17
- data/virtualbox.gemspec +4 -2
- metadata +224 -250
- data/lib/virtualbox/com/ffi/interfaces.rb +0 -64
- data/lib/virtualbox/com/interface/3.1.x/access_mode.rb +0 -11
- data/lib/virtualbox/com/interface/3.1.x/appliance.rb +0 -22
- data/lib/virtualbox/com/interface/3.1.x/audio_driver_type.rb +0 -11
- data/lib/virtualbox/com/interface/3.1.x/bios_settings.rb +0 -21
- data/lib/virtualbox/com/interface/3.1.x/clipboard_mode.rb +0 -11
- data/lib/virtualbox/com/interface/3.1.x/cpu_property_type.rb +0 -11
- data/lib/virtualbox/com/interface/3.1.x/guest_os_type.rb +0 -23
- data/lib/virtualbox/com/interface/3.1.x/host_network_interface_status.rb +0 -11
- data/lib/virtualbox/com/interface/3.1.x/host_usb_device_filter.rb +0 -13
- data/lib/virtualbox/com/interface/3.1.x/machine.rb +0 -105
- data/lib/virtualbox/com/interface/3.1.x/medium.rb +0 -50
- data/lib/virtualbox/com/interface/3.1.x/medium_type.rb +0 -11
- data/lib/virtualbox/com/interface/3.1.x/network_adapter.rb +0 -30
- data/lib/virtualbox/com/interface/3.1.x/parallel_port.rb +0 -17
- data/lib/virtualbox/com/interface/3.1.x/progress.rb +0 -63
- data/lib/virtualbox/com/interface/3.1.x/session.rb +0 -18
- data/lib/virtualbox/com/interface/3.1.x/storage_bus.rb +0 -11
- data/lib/virtualbox/com/interface/3.1.x/storage_controller.rb +0 -23
- data/lib/virtualbox/com/interface/3.1.x/storage_controller_type.rb +0 -11
- data/lib/virtualbox/com/interface/3.1.x/system_properties.rb +0 -37
- data/lib/virtualbox/com/interface/3.1.x/usb_controller.rb +0 -20
- data/lib/virtualbox/com/interface/3.1.x/usb_device_filter_action.rb +0 -11
- data/lib/virtualbox/com/interface/3.1.x/usb_device_state.rb +0 -11
- data/lib/virtualbox/com/interface/3.1.x/virtual_box_error_info.rb +0 -17
- data/lib/virtualbox/com/interface/3.1.x/virtual_system_description.rb +0 -19
- data/lib/virtualbox/com/interface/3.1.x/virtual_system_description_type.rb +0 -14
- data/lib/virtualbox/com/interface/3.1.x/virtual_system_description_value_type.rb +0 -11
- data/lib/virtualbox/com/interface/3.1.x/virtualbox.rb +0 -67
- data/lib/virtualbox/com/interface/3.1.x/vrdp_server.rb +0 -19
- data/lib/virtualbox/com/interface/3.2.x/audio_adapter.rb +0 -15
- data/lib/virtualbox/com/interface/3.2.x/audio_controller_type.rb +0 -11
- data/lib/virtualbox/com/interface/3.2.x/bios_boot_menu_mode.rb +0 -11
- data/lib/virtualbox/com/interface/3.2.x/console.rb +0 -50
- data/lib/virtualbox/com/interface/3.2.x/device_type.rb +0 -11
- data/lib/virtualbox/com/interface/3.2.x/dhcp_server.rb +0 -22
- data/lib/virtualbox/com/interface/3.2.x/firmware_type.rb +0 -11
- data/lib/virtualbox/com/interface/3.2.x/host.rb +0 -43
- data/lib/virtualbox/com/interface/3.2.x/host_network_interface.rb +0 -30
- data/lib/virtualbox/com/interface/3.2.x/host_network_interface_medium_type.rb +0 -11
- data/lib/virtualbox/com/interface/3.2.x/host_network_interface_type.rb +0 -11
- data/lib/virtualbox/com/interface/3.2.x/host_usb_device.rb +0 -13
- data/lib/virtualbox/com/interface/3.2.x/hw_virt_ex_property_type.rb +0 -11
- data/lib/virtualbox/com/interface/3.2.x/machine_state.rb +0 -14
- data/lib/virtualbox/com/interface/3.2.x/medium_attachment.rb +0 -18
- data/lib/virtualbox/com/interface/3.2.x/medium_format.rb +0 -18
- data/lib/virtualbox/com/interface/3.2.x/medium_state.rb +0 -11
- data/lib/virtualbox/com/interface/3.2.x/medium_variant.rb +0 -11
- data/lib/virtualbox/com/interface/3.2.x/network_adapter_type.rb +0 -11
- data/lib/virtualbox/com/interface/3.2.x/network_attachment_type.rb +0 -11
- data/lib/virtualbox/com/interface/3.2.x/nsiexception.rb +0 -23
- data/lib/virtualbox/com/interface/3.2.x/nsisupports.rb +0 -15
- data/lib/virtualbox/com/interface/3.2.x/port_mode.rb +0 -11
- data/lib/virtualbox/com/interface/3.2.x/serial_port.rb +0 -19
- data/lib/virtualbox/com/interface/3.2.x/session_state.rb +0 -11
- data/lib/virtualbox/com/interface/3.2.x/session_type.rb +0 -11
- data/lib/virtualbox/com/interface/3.2.x/shared_folder.rb +0 -17
- data/lib/virtualbox/com/interface/3.2.x/snapshot.rb +0 -20
- data/lib/virtualbox/com/interface/3.2.x/usb_device.rb +0 -24
- data/lib/virtualbox/com/interface/3.2.x/usb_device_filter.rb +0 -23
- data/lib/virtualbox/com/interface/3.2.x/virtual_system_description_type.rb +0 -14
- data/lib/virtualbox/com/interface/3.2.x/vrdp_auth_type.rb +0 -11
- data/lib/virtualbox/com/interface/3.2.x/vrdp_server.rb +0 -21
- data/lib/virtualbox/ext/glob_loader.rb +0 -35
@@ -12,7 +12,7 @@ module VirtualBox
|
|
12
12
|
class ReadonlyVMStateException < Exception; end
|
13
13
|
class UnsupportedVersionException < Exception; end
|
14
14
|
|
15
|
-
class
|
15
|
+
class COMException < Exception
|
16
16
|
attr_accessor :data
|
17
17
|
|
18
18
|
def initialize(data={})
|
@@ -23,17 +23,18 @@ module VirtualBox
|
|
23
23
|
|
24
24
|
# FFI Exceptions, these exceptions are only raised on *nix machines
|
25
25
|
# when some error occurs in the foreign function interface.
|
26
|
-
class ObjectNotFoundException <
|
27
|
-
class InvalidVMStateException <
|
28
|
-
class VMErrorException <
|
29
|
-
class FileErrorException <
|
30
|
-
class SubsystemException <
|
31
|
-
class PDMException <
|
32
|
-
class InvalidObjectStateException <
|
33
|
-
class HostErrorException <
|
34
|
-
class NotSupportedException <
|
35
|
-
class XMLErrorException <
|
36
|
-
class InvalidSessionStateException <
|
37
|
-
class ObjectInUseException <
|
26
|
+
class ObjectNotFoundException < COMException; end
|
27
|
+
class InvalidVMStateException < COMException; end
|
28
|
+
class VMErrorException < COMException; end
|
29
|
+
class FileErrorException < COMException; end
|
30
|
+
class SubsystemException < COMException; end
|
31
|
+
class PDMException < COMException; end
|
32
|
+
class InvalidObjectStateException < COMException; end
|
33
|
+
class HostErrorException < COMException; end
|
34
|
+
class NotSupportedException < COMException; end
|
35
|
+
class XMLErrorException < COMException; end
|
36
|
+
class InvalidSessionStateException < COMException; end
|
37
|
+
class ObjectInUseException < COMException; end
|
38
|
+
class InvalidArgException < COMException; end
|
38
39
|
end
|
39
40
|
end
|
@@ -132,7 +132,7 @@ module VirtualBox
|
|
132
132
|
|
133
133
|
validates_presence_of :location
|
134
134
|
|
135
|
-
max_vdi_size = Global.global.system_properties.
|
135
|
+
max_vdi_size = Global.global.system_properties.info_vdi_size
|
136
136
|
validates_inclusion_of :logical_size, :in => (0..max_vdi_size), :message => "must be between 0 and #{max_vdi_size}."
|
137
137
|
end
|
138
138
|
|
@@ -91,7 +91,7 @@ module VirtualBox
|
|
91
91
|
def attached_vms
|
92
92
|
parent.parent.vms.find_all do |vm|
|
93
93
|
result = vm.network_adapters.find do |adapter|
|
94
|
-
adapter.enabled? && adapter.
|
94
|
+
adapter.enabled? && adapter.host_only_interface == name
|
95
95
|
end
|
96
96
|
|
97
97
|
!result.nil?
|
data/lib/virtualbox/lib.rb
CHANGED
data/lib/virtualbox/medium.rb
CHANGED
@@ -44,7 +44,7 @@ module VirtualBox
|
|
44
44
|
# attribute :cable_connected, :boolean => true
|
45
45
|
# attribute :nat_network
|
46
46
|
# attribute :internal_network
|
47
|
-
# attribute :
|
47
|
+
# attribute :host_only_interface
|
48
48
|
# attribute :interface, :readonly => true, :property => false
|
49
49
|
#
|
50
50
|
class NetworkAdapter < AbstractModel
|
@@ -57,7 +57,7 @@ module VirtualBox
|
|
57
57
|
attribute :cable_connected, :boolean => true
|
58
58
|
attribute :nat_network
|
59
59
|
attribute :internal_network
|
60
|
-
attribute :
|
60
|
+
attribute :host_only_interface
|
61
61
|
attribute :interface, :readonly => true, :property => false
|
62
62
|
relationship :nat_driver, :NATEngine, :lazy => true
|
63
63
|
|
@@ -70,8 +70,9 @@ module VirtualBox
|
|
70
70
|
def populate_relationship(caller, imachine)
|
71
71
|
relation = Proxies::Collection.new(caller)
|
72
72
|
|
73
|
-
# Get the count of network adapters
|
74
|
-
|
73
|
+
# Get the count of network adapters for a chipset of the type
|
74
|
+
# that is our machine.
|
75
|
+
count = imachine.parent.system_properties.get_max_network_adapters(imachine.chipset_type)
|
75
76
|
|
76
77
|
count.times do |i|
|
77
78
|
relation << new(caller, imachine.get_network_adapter(i))
|
@@ -125,35 +126,18 @@ module VirtualBox
|
|
125
126
|
# exists.
|
126
127
|
def host_interface_object
|
127
128
|
VirtualBox::Global.global.host.network_interfaces.find do |ni|
|
128
|
-
ni.name ==
|
129
|
+
ni.name == host_only_interface
|
129
130
|
end
|
130
131
|
end
|
131
132
|
|
132
133
|
# Save a network adapter.
|
133
134
|
def save
|
134
135
|
modify_adapter do |adapter|
|
135
|
-
save_attachment_type(adapter)
|
136
136
|
save_changed_interface_attributes(adapter)
|
137
137
|
save_relationships
|
138
138
|
end
|
139
139
|
end
|
140
140
|
|
141
|
-
# Saves the attachment type. This should never be called directly. Instead,
|
142
|
-
# {save} should be called, which will call this method if appropriate.
|
143
|
-
def save_attachment_type(adapter)
|
144
|
-
return unless attachment_type_changed?
|
145
|
-
|
146
|
-
mapping = {
|
147
|
-
:nat => :attach_to_nat,
|
148
|
-
:bridged => :attach_to_bridged_interface,
|
149
|
-
:internal => :attach_to_internal_network,
|
150
|
-
:host_only => :attach_to_host_only_interface
|
151
|
-
}
|
152
|
-
|
153
|
-
adapter.send(mapping[attachment_type])
|
154
|
-
clear_dirty!(:attachment_type)
|
155
|
-
end
|
156
|
-
|
157
141
|
# Opens a session, yields the adapter and then saves the machine at
|
158
142
|
# the end
|
159
143
|
def modify_adapter
|
@@ -13,7 +13,6 @@ module VirtualBox
|
|
13
13
|
attribute :min_guest_cpu_count, :readonly => true
|
14
14
|
attribute :max_guest_cpu_count, :readonly => true
|
15
15
|
attribute :info_vd_size, :readonly => true
|
16
|
-
attribute :network_adapter_count, :readonly => true
|
17
16
|
attribute :serial_port_count, :readonly => true
|
18
17
|
attribute :parallel_port_count, :readonly => true
|
19
18
|
attribute :max_boot_position, :readonly => true
|
data/lib/virtualbox/version.rb
CHANGED
@@ -1,36 +1,34 @@
|
|
1
1
|
module VirtualBox
|
2
|
-
VERSION = "0.
|
2
|
+
VERSION = "0.9.0"
|
3
3
|
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
end
|
4
|
+
# Returns a boolean denoting whether the current VirtualBox
|
5
|
+
# version is supported or not. This will return `false` if the
|
6
|
+
# version is invalid, the version is not detected, etc. That means
|
7
|
+
# that even if VirtualBox is not installed, this will simply
|
8
|
+
# return `false`.
|
9
|
+
#
|
10
|
+
# @return [Boolean]
|
11
|
+
def self.supported?
|
12
|
+
!version.nil?
|
13
|
+
end
|
15
14
|
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
15
|
+
# Returns the version string of the VirtualBox installed, ex. "3.1.6"
|
16
|
+
# This string is cached since the version typically doesn't change
|
17
|
+
# during runtime. If you must refresh the version, send the boolean
|
18
|
+
# `true` as the first parameter.
|
19
|
+
def self.version(refresh=false)
|
20
|
+
@_version = Lib.lib.virtualbox.version if @_version.nil? || refresh
|
21
|
+
@_version
|
22
|
+
rescue Exception
|
23
|
+
nil
|
24
|
+
end
|
26
25
|
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
end
|
26
|
+
# Returns the revision string of the VirtualBox installed, ex. "51742"
|
27
|
+
# This string is cached since the revision doesn't typically change during
|
28
|
+
# runtime. If you must refresh the version, send the boolean `true` as the
|
29
|
+
# first parameter.
|
30
|
+
def self.revision(refresh=false)
|
31
|
+
@_revision = Lib.lib.virtualbox.revision.to_s if @_revision.nil? || refresh
|
32
|
+
@_revision
|
35
33
|
end
|
36
34
|
end
|
data/lib/virtualbox/vm.rb
CHANGED
@@ -133,52 +133,57 @@ module VirtualBox
|
|
133
133
|
# relationship :current_snapshot, :Snapshot
|
134
134
|
#
|
135
135
|
class VM < AbstractModel
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
:
|
167
|
-
:
|
136
|
+
attribute_scope :lazy => true do
|
137
|
+
attribute :uuid, :readonly => true, :property => :id
|
138
|
+
attribute :name
|
139
|
+
attribute :os_type_id
|
140
|
+
attribute :description
|
141
|
+
attribute :memory_size
|
142
|
+
attribute :memory_balloon_size
|
143
|
+
attribute :vram_size
|
144
|
+
attribute :cpu_count
|
145
|
+
attribute :cpu_hot_plug_enabled, :boolean => true
|
146
|
+
attribute :cpu_execution_cap
|
147
|
+
attribute :accelerate_3d_enabled, :boolean => true
|
148
|
+
attribute :accelerate_2d_video_enabled, :boolean => true
|
149
|
+
attribute :clipboard_mode
|
150
|
+
attribute :monitor_count
|
151
|
+
attribute :state, :readonly => true
|
152
|
+
attribute :accessible, :readonly => true, :boolean => true
|
153
|
+
attribute :hardware_version
|
154
|
+
attribute :hardware_uuid
|
155
|
+
attribute :firmware_type
|
156
|
+
attribute :snapshot_folder
|
157
|
+
attribute :settings_file_path, :readonly => true
|
158
|
+
attribute :last_state_change, :readonly => true
|
159
|
+
attribute :state_file_path, :readonly => true
|
160
|
+
attribute :log_folder, :readonly => true
|
161
|
+
attribute :snapshot_count, :readonly => true
|
162
|
+
attribute :current_state_modified, :readonly => true
|
163
|
+
attribute :guest_property_notification_patterns
|
164
|
+
attribute :teleporter_enabled, :boolean => true
|
165
|
+
attribute :teleporter_port
|
166
|
+
attribute :teleporter_address
|
167
|
+
attribute :teleporter_password
|
168
|
+
attribute :boot_order,
|
169
|
+
:property_getter => Proc.new { |instance, *args| instance.get_boot_order(*args) },
|
170
|
+
:property_setter => Proc.new { |instance, *args| instance.set_boot_order(*args) }
|
171
|
+
end
|
172
|
+
|
168
173
|
attribute :interface, :readonly => true, :property => false
|
169
|
-
relationship :audio_adapter, :AudioAdapter
|
170
|
-
relationship :bios, :BIOS
|
171
|
-
relationship :hw_virt, :HWVirtualization
|
172
|
-
relationship :cpu, :CPU
|
173
|
-
relationship :vrde_server, :VRDEServer
|
174
|
-
relationship :storage_controllers, :StorageController, :dependent => :destroy
|
175
|
-
relationship :medium_attachments, :MediumAttachment
|
176
|
-
relationship :shared_folders, :SharedFolder
|
177
|
-
relationship :extra_data, :ExtraData
|
178
|
-
relationship :forwarded_ports, :ForwardedPort, :version => "3.1"
|
179
|
-
relationship :network_adapters, :NetworkAdapter
|
180
|
-
relationship :usb_controller, :USBController
|
181
|
-
relationship :current_snapshot, :Snapshot
|
174
|
+
relationship :audio_adapter, :AudioAdapter, :lazy => true
|
175
|
+
relationship :bios, :BIOS, :lazy => true
|
176
|
+
relationship :hw_virt, :HWVirtualization, :lazy => true
|
177
|
+
relationship :cpu, :CPU, :lazy => true
|
178
|
+
relationship :vrde_server, :VRDEServer, :lazy => true
|
179
|
+
relationship :storage_controllers, :StorageController, :dependent => :destroy, :lazy => true
|
180
|
+
relationship :medium_attachments, :MediumAttachment, :lazy => true
|
181
|
+
relationship :shared_folders, :SharedFolder, :lazy => true
|
182
|
+
relationship :extra_data, :ExtraData, :lazy => true
|
183
|
+
relationship :forwarded_ports, :ForwardedPort, :version => "3.1", :lazy => true
|
184
|
+
relationship :network_adapters, :NetworkAdapter, :lazy => true
|
185
|
+
relationship :usb_controller, :USBController, :lazy => true
|
186
|
+
relationship :current_snapshot, :Snapshot, :lazy => true
|
182
187
|
|
183
188
|
class << self
|
184
189
|
# Returns an array of all available VMs.
|
@@ -193,7 +198,12 @@ module VirtualBox
|
|
193
198
|
#
|
194
199
|
# @return [VM]
|
195
200
|
def find(name)
|
196
|
-
|
201
|
+
new(Lib.lib.virtualbox.find_machine(name))
|
202
|
+
rescue Exceptions::ObjectNotFoundException
|
203
|
+
nil
|
204
|
+
rescue Exceptions::COMException
|
205
|
+
# NOTE: This only happens on JRuby/Windows
|
206
|
+
nil
|
197
207
|
end
|
198
208
|
|
199
209
|
# Imports a VM, blocking the entire thread during this time.
|
@@ -250,12 +260,6 @@ module VirtualBox
|
|
250
260
|
end
|
251
261
|
|
252
262
|
def initialize_attributes(machine)
|
253
|
-
# Load the interface attributes
|
254
|
-
load_interface_attributes(machine)
|
255
|
-
|
256
|
-
# Setup the relationships
|
257
|
-
populate_relationships(machine)
|
258
|
-
|
259
263
|
# Clear dirtiness, since this should only be called initially and
|
260
264
|
# therefore shouldn't affect dirtiness
|
261
265
|
clear_dirty!
|
@@ -264,11 +268,26 @@ module VirtualBox
|
|
264
268
|
existing_record!
|
265
269
|
end
|
266
270
|
|
271
|
+
def load_attribute(key)
|
272
|
+
read_interface_attribute(key, interface)
|
273
|
+
end
|
274
|
+
|
275
|
+
def load_relationship(name)
|
276
|
+
# Load only the requested relationship
|
277
|
+
populate_relationship(name, interface)
|
278
|
+
end
|
279
|
+
|
267
280
|
# Reload the model so that all the attributes and relationships are
|
268
281
|
# up to date. This method will automatically discard any changes to
|
269
282
|
# the VM and any of its relationships.
|
270
283
|
def reload
|
284
|
+
# Reset relationships and attributes
|
285
|
+
reset_attributes
|
286
|
+
reset_relationships
|
287
|
+
|
288
|
+
# Initialize again
|
271
289
|
initialize_attributes(interface)
|
290
|
+
|
272
291
|
self
|
273
292
|
end
|
274
293
|
|
@@ -554,14 +573,15 @@ module VirtualBox
|
|
554
573
|
# also unregister attached media. If set to `:delete`, it will
|
555
574
|
# not only unregister attached media, but will also physically
|
556
575
|
# remove their respective data.
|
557
|
-
def destroy
|
576
|
+
def destroy
|
558
577
|
# Do a full cleanup on the machine, then delete all the media attached
|
559
578
|
media = interface.unregister(:full)
|
560
579
|
|
561
580
|
if !media.empty?
|
562
|
-
if Platform.windows?
|
581
|
+
if Platform.windows?
|
563
582
|
# The MSCOM interface in CRuby to delete media is broken,
|
564
|
-
# so we do this ghettoness.
|
583
|
+
# so we do this ghettoness. Also, in JRuby, passing an array
|
584
|
+
# to objects is broken. So once again, we do this.
|
565
585
|
path = interface.settings_file_path
|
566
586
|
|
567
587
|
# A simple sanity check to make sure we don't attempt to delete
|
data/test/test_helper.rb
CHANGED
@@ -11,8 +11,5 @@ require 'virtualbox'
|
|
11
11
|
class Test::Unit::TestCase
|
12
12
|
end
|
13
13
|
|
14
|
-
#
|
15
|
-
|
16
|
-
# the FFI classes, we force initialize a specific version here. It
|
17
|
-
# doesn't matter what version, since no actual FFI calls are made.
|
18
|
-
VirtualBox::COM::FFI.setup("3.2.x") unless defined?(VirtualBox::COM::FFI::Version_3_2_X)
|
14
|
+
# Set the interface version manually since we don't do detection in tests
|
15
|
+
VirtualBox::COM::Util.set_interface_version("4.0.x")
|
@@ -194,6 +194,28 @@ class AttributableTest < Test::Unit::TestCase
|
|
194
194
|
end
|
195
195
|
end
|
196
196
|
|
197
|
+
context "resetting attributes" do
|
198
|
+
class ResetAttributeModel < AttributeModel
|
199
|
+
attribute :normal
|
200
|
+
attribute :lazy, :lazy => true
|
201
|
+
end
|
202
|
+
|
203
|
+
setup do
|
204
|
+
@model = ResetAttributeModel.new
|
205
|
+
@model.populate_attributes({
|
206
|
+
:normal => "normal",
|
207
|
+
:lazy => "lazy"
|
208
|
+
})
|
209
|
+
end
|
210
|
+
|
211
|
+
should "only reset the lazy attributes" do
|
212
|
+
assert @model.loaded_attribute?(:lazy)
|
213
|
+
@model.reset_attributes
|
214
|
+
assert !@model.loaded_attribute?(:lazy)
|
215
|
+
assert_equal "normal", @model.normal
|
216
|
+
end
|
217
|
+
end
|
218
|
+
|
197
219
|
context "reading and writing attributes" do
|
198
220
|
class VersionedAttributeModel < AttributeModel
|
199
221
|
attribute :ver, :version => "3.1"
|
@@ -152,6 +152,27 @@ class RelatableTest < Test::Unit::TestCase
|
|
152
152
|
end
|
153
153
|
end
|
154
154
|
|
155
|
+
context "resetting relationships" do
|
156
|
+
class ResetRelatableModel < EmptyRelatableModel
|
157
|
+
relationship :foos, RelatableTest::Relatee
|
158
|
+
relationship :bars, RelatableTest::BarRelatee, :lazy => true
|
159
|
+
end
|
160
|
+
|
161
|
+
setup do
|
162
|
+
@model = ResetRelatableModel.new
|
163
|
+
end
|
164
|
+
|
165
|
+
should "reset only the lazy relationship" do
|
166
|
+
@model.relationship_data[:foos] = "YES"
|
167
|
+
@model.relationship_data[:bars] = "YES"
|
168
|
+
|
169
|
+
assert @model.loaded_relationship?(:bars)
|
170
|
+
@model.reset_relationships
|
171
|
+
assert !@model.loaded_relationship?(:bars)
|
172
|
+
assert_equal "YES", @model.foos
|
173
|
+
end
|
174
|
+
end
|
175
|
+
|
155
176
|
context "lazy relationships" do
|
156
177
|
class LazyRelatableModel < EmptyRelatableModel
|
157
178
|
relationship :foos, RelatableTest::Relatee, :lazy => true
|