Module: VirtualBox::Version

Included in:
VirtualBox
Defined in:
lib/virtualbox/version.rb

Instance Method Summary (collapse)

Instance Method Details

- (Object) revision(refresh = false)

Returns the revision string of the VirtualBox installed, ex. "51742" This string is cached since the revision doesn't typically change during runtime. If you must refresh the version, send the boolean `true` as the first parameter.



31
32
33
34
# File 'lib/virtualbox/version.rb', line 31

def revision(refresh=false)
  @_revision = Lib.lib.virtualbox.revision.to_s if @_revision.nil? || refresh
  @_revision
end

- (Boolean) supported?

Returns a boolean denoting whether the current VirtualBox version is supported or not. This will return `false` if the version is invalid, the version is not detected, etc. That means that even if VirtualBox is not installed, this will simply return `false`.

Returns:

  • (Boolean)


12
13
14
# File 'lib/virtualbox/version.rb', line 12

def supported?
  !version.nil?
end

- (Object) version(refresh = false)

Returns the version string of the VirtualBox installed, ex. "3.1.6" This string is cached since the version typically doesn't change during runtime. If you must refresh the version, send the boolean `true` as the first parameter.



20
21
22
23
24
25
# File 'lib/virtualbox/version.rb', line 20

def version(refresh=false)
  @_version = Lib.lib.virtualbox.version if @_version.nil? || refresh
  @_version
rescue Exception
  nil
end