struct DeviceDetector::Parser::OS

Included Modules

Defined in:

device_detector/parser/os.cr

Constant Summary

ANDROID_REGEX = /Android[ ;\/](\d+[.\d]*)/i
ANDROID_TV_HINTS = /(?:Android(?: UHD)?|Smart)[ _]?TV|AndroidTV|GoogleTV|BRAVIA|wv-atv/i
GENERIC_LINUX_REGEX = /X11; Linux|Linux (?:x86_64|i686|aarch64|armv7l)/i
IOS_REGEX = /(?:CPU OS|iPh(?:one)?[ _]OS|iPhone.+ OS|iOS)[ _\/](\d+(?:[_.]\d+)*)/i
LINUX_DISTRO_HINTS = /Fedora|Ubuntu|Debian|CentOS|Red Hat|RHEL|Gentoo|Arch Linux|SUSE|Mandriva|Mageia|Mint/i
MACOS_REGEX = /Mac[ +]OS[ +]?X(?:[ \/,](?:Version )?(\d+(?:[_.]\d+)+))?/i
WINDOWS_NT_REGEX = /Windows NT (\d+\.\d+)/i
WINDOWS_NT_VERSIONS = {"10.0" => "10", "6.4" => "10", "6.3" => "8.1", "6.2" => "8", "6.1" => "7", "6.0" => "Vista", "5.2" => "Server 2003", "5.1" => "XP", "5.0" => "2000", "4.0" => "NT"}

Constructors

Instance Method Summary

Instance methods inherited from module DeviceDetector::Helper

capture_groups?(str : String) capture_groups?, desktop?(user_agent : String) desktop?, fill_groups(str : String, regex : String, user_agent : String) fill_groups, human_browser?(user_agent : String) human_browser?, regex(pattern : String, options : Regex::Options)
regex(pattern : String)
regex
, token_candidates(index : Hash(String, Array(Int32)), user_agent : String, reverse = false) token_candidates

Constructor Detail

def self.new(user_agent : String) #

[View source]

Instance Method Detail

def android_os #

[View source]
def call #

[View source]
def common_os #

[View source]
def detect_os(operating_system, detected_os) #

[View source]
def generic_linux_os #

[View source]
def ios_os #

[View source]
def kind : String #

[View source]
def macos_os #

[View source]
def os #

[View source]
def os_index #

[View source]
def os_result(name, version = "") #

[View source]
def windows_nt_os #

[View source]