class Launchy::Detect::HostOsFamily
Detect
the current host os family
If the current host familiy cannot be detected then return HostOsFamily::Unknown
Attributes
Public Class Methods
Source
# File lib/launchy/detect/host_os_family.rb, line 37 def cygwin? self == Cygwin end
Source
# File lib/launchy/detect/host_os_family.rb, line 29 def darwin? self == Darwin end
Source
# File lib/launchy/detect/host_os_family.rb, line 14 def detect(host_os = HostOs.new) found = find_child(:matches?, host_os) return found.new(host_os) if found raise NotFoundError, "Unknown OS family for host os '#{host_os}'. #{Launchy.bug_report_message}" end
Source
# File lib/launchy/detect/host_os_family.rb, line 21 def matches?(host_os) matching_regex.match(host_os.to_s) end
Source
# File lib/launchy/detect/host_os_family.rb, line 44 def initialize(host_os = HostOs.new) @host_os = host_os end
Source
# File lib/launchy/detect/host_os_family.rb, line 25 def windows? self == Windows end
Public Instance Methods
Source
# File lib/launchy/detect/host_os_family.rb, line 60 def cygwin? self.class.cygwin? end
Source
# File lib/launchy/detect/host_os_family.rb, line 52 def darwin? self.class.darwin? end
Source
# File lib/launchy/detect/host_os_family.rb, line 48 def windows? self.class.windows? end