Sha256: ebb5aea74f4f3acd8f11686e252a804a82df307b56663c7e1fb7c9a526e607b9

Contents?: true

Size: 1.21 KB

Versions: 2

Compression:

Stored size: 1.21 KB

Contents

module VirtualBox
  VERSION = "0.8.4"

  module Version
    # 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`.
    #
    # @return [Boolean]
    def supported?
      !version.nil?
    end

    # 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.
    def version(refresh=false)
      @_version = Lib.lib.virtualbox.version if @_version.nil? || refresh
      @_version
    rescue Exception
      nil
    end

    # 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.
    def revision(refresh=false)
      @_revision = Lib.lib.virtualbox.revision.to_s if @_revision.nil? || refresh
      @_revision
    end
  end
end

Version data entries

2 entries across 2 versions & 2 rubygems

Version Path
virtualbox-0.8.4 lib/virtualbox/version.rb
velir_virtualbox-0.8.4 lib/virtualbox/version.rb