Module: Alfred::OSX

Defined in:
lib/alfred/osx.rb

Class Method Summary collapse

Class Method Details

.full_nameObject



19
20
21
# File 'lib/alfred/osx.rb', line 19

def full_name
  "Mac OS X " + version_number
end

.notification_center?Boolean

Returns:

  • (Boolean)


14
15
16
# File 'lib/alfred/osx.rb', line 14

def notification_center?
  version[:major] >= 10.8
end

.short_nameObject



24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
# File 'lib/alfred/osx.rb', line 24

def short_name
  case version[:major]
  when 10.4
    short_name = "Tiger"
  when 10.5
    short_name = "Leopard"
  when 10.6
    short_name = "Snow Leopard"
  when 10.7
    short_name = "Lion"
  when 10.8
    short_name = "Mountain Lion"
  when 10.9
    short_name = "Mavericks"
  end

  return short_name
end

.versionObject



6
7
8
# File 'lib/alfred/osx.rb', line 6

def version
  @version ||= get_osx_version
end

.version_numberObject



10
11
12
# File 'lib/alfred/osx.rb', line 10

def version_number
  "#{version[:major]}.#{version[:minor]}"
end