Module: Pomo::OS

Defined in:
lib/pomo/os.rb

Class Method Summary collapse

Class Method Details

.has_notification_center?Boolean

Returns:

  • (Boolean)


19
20
21
22
23
24
25
# File 'lib/pomo/os.rb', line 19

def has_notification_center?
  return false unless OS.mac?

  full_version = `/usr/bin/sw_vers -productVersion`.to_s.chomp
  version = /(10\.\d+)(\.\d+)?/.match(full_version).captures.first.to_f
  return (version >= 10.8)
end

.linux?Boolean

Returns:

  • (Boolean)


7
8
9
# File 'lib/pomo/os.rb', line 7

def linux?
  (/linux/ =~ RbConfig::CONFIG['host_os']) !=nil
end

.mac?Boolean

Returns:

  • (Boolean)


11
12
13
# File 'lib/pomo/os.rb', line 11

def mac?
  (/mac|darwin/ =~ RbConfig::CONFIG['host_os']) != nil
end

.windows?Boolean

Returns:

  • (Boolean)


15
16
17
# File 'lib/pomo/os.rb', line 15

def windows?
  (/cygwin|mswin|mingw|bccwin|wince|emx/ =~ RbConfig::CONFIG['host_os']) != nil
end