Module: Aua::OperatingSystems::Windows
- Defined in:
- lib/aua/operating_systems/windows.rb
Constant Summary collapse
- VERSIONS =
{ "10.0" => "10", "NT 10.0" => "10", "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", "NT 5.0" => "2000", "NT 4.0" => "NT 4.0", "98" => "98", "95" => "95", "CE" => "CE", "9x 4.90" => "ME" }
- PATTERN =
/Win(dows)?(\sPhone)?\s?([\d\sA-Zx\.]+)/
- PHONE_PATTERN =
/Windows Phone/
Class Method Summary collapse
Instance Method Summary collapse
Class Method Details
.extend?(agent) ⇒ Boolean
3 4 5 6 7 |
# File 'lib/aua/operating_systems/windows.rb', line 3 def self.extend?(agent) agent.comments.first && (agent.app_comments.include?("Windows") || agent.comments_string =~ PATTERN) end |
Instance Method Details
#os_name ⇒ Object
34 35 36 |
# File 'lib/aua/operating_systems/windows.rb', line 34 def os_name @os_name ||= windows_phone? ? :WindowsPhone : :Windows end |
#os_version ⇒ Object
38 39 40 |
# File 'lib/aua/operating_systems/windows.rb', line 38 def os_version @os_version ||= comments_string =~ PATTERN && VERSIONS[$3] || $3 end |
#platform ⇒ Object
30 31 32 |
# File 'lib/aua/operating_systems/windows.rb', line 30 def platform :Windows end |