class Dictation::OperatingSystem

Constants

SUPPORTED_TYPE
TYPE

Public Class Methods

supported?() click to toggle source
# File lib/dictation/operating_system.rb, line 36
def supported?
  SUPPORTED_TYPE.include?(what)
end

Private Class Methods

is_linux?() click to toggle source
# File lib/dictation/operating_system.rb, line 17
def is_linux?
  match_os(/linux/)
end
is_mac?() click to toggle source
# File lib/dictation/operating_system.rb, line 21
def is_mac?
  match_os(/darwin/)
end
is_windows?() click to toggle source
# File lib/dictation/operating_system.rb, line 25
def is_windows?
  match_os(/mswin|mingw|cygwin|bccwin|wince|emx/)
end
match_os(regex) click to toggle source
# File lib/dictation/operating_system.rb, line 13
def match_os(regex)
  !!RUBY_PLATFORM.match(regex)
end
what() click to toggle source
# File lib/dictation/operating_system.rb, line 29
def what
  return TYPE[:lin] if is_linux?
  return TYPE[:mac] if is_mac?
  return TYPE[:win] if is_windows?
  return TYPE[:unknown]
end