class AutomateIt::PlatformManager::Windows

PlatformManager::Windows

A PlatformManager driver for Windows systems.

Public Instance Methods

available?() click to toggle source
# File lib/automateit/platform_manager/windows.rb, line 5
def available?
  return RUBY_PLATFORM.match(/mswin/) ? true : false
end
query(search) click to toggle source
# File lib/automateit/platform_manager/windows.rb, line 32
def query(search)
  _prepare
  super(search)
end
single_vendor?() click to toggle source
# File lib/automateit/platform_manager/windows.rb, line 37
def single_vendor?
  return true
end

Private Instance Methods

_prepare() click to toggle source
# File lib/automateit/platform_manager/windows.rb, line 14
def _prepare
  return if @struct[:release]
  @struct[:os] = "windows"
  @struct[:arch] = ENV["PROCESSOR_ARCHITECTURE"]
  @struct[:distro] = "microsoft"

  # VER values: http://www.ss64.com/nt/ver.html
  ver = `ver`.strip
  if match = ver.match(/Windows (\w+)/)
    @struct[:release] = match[1].downcase
  elsif match = ver.match(/Windows \[Version 6\.0\./)
    @struct[:release] = "vista"
  end

  @struct
end