Sha256: 74865742c9b179fc3a075d9e26071a1b47ae980fa16a93afbe17faf2d25a03ca

Contents?: true

Size: 689 Bytes

Versions: 7

Compression:

Stored size: 689 Bytes

Contents

module Aua::OperatingSystems::Windows
  
  def self.extend?(agent)
    agent.comments.first && 
    (agent.app_comments.include?("Windows") ||
    agent.comments_string =~ PATTERN)
  end
  
  VERSIONS = {
    "NT 6.1"  => "7",
    "NT 6.0"  => "Vista",
    "NT 5.2"  => "XP",
    "NT 5.1"  => "XP",
    "NT 5.01" => "2000",
    "NT 5.0"  => "2000",
    "NT 4.0"  => "NT 4.0",
    "98"      => "98",
    "95"      => "95",
    "CE"      => "CE",
    "9x 4.90" => "ME"
  }
  
  PATTERN = /Win(dows)?\s?([\d\sA-Zx\.]+)/
  
  def platform
    :Windows
  end
  
  def os_name
    :Windows
  end
  
  def os_version
    @os_version ||= comments_string =~ PATTERN && VERSIONS[$2] || $2 
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
aua-0.2.2 lib/aua/operating_systems/windows.rb
aua-0.2.1 lib/aua/operating_systems/windows.rb
aua-0.2.0 lib/aua/operating_systems/windows.rb
aua-0.1.3 lib/aua/operating_systems/windows.rb
aua-0.1.2 lib/aua/operating_systems/windows.rb
aua-0.1.1 lib/aua/operating_systems/windows.rb
aua-0.1.0 lib/aua/operating_systems/windows.rb