lib/aua/operating_systems/windows.rb in aua-0.2.2 vs lib/aua/operating_systems/windows.rb in aua-0.2.3
- old
+ new
@@ -1,14 +1,16 @@
module Aua::OperatingSystems::Windows
-
+
def self.extend?(agent)
- agent.comments.first &&
+ agent.comments.first &&
(agent.app_comments.include?("Windows") ||
agent.comments_string =~ PATTERN)
end
-
+
VERSIONS = {
+ "NT 6.3" => "8.1",
+ "NT 6.2" => "8",
"NT 6.1" => "7",
"NT 6.0" => "Vista",
"NT 5.2" => "XP",
"NT 5.1" => "XP",
"NT 5.01" => "2000",
@@ -17,20 +19,20 @@
"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
+ @os_version ||= comments_string =~ PATTERN && VERSIONS[$2] || $2
end
end
\ No newline at end of file