Class: Tacape::Belt

Inherits:
Object
  • Object
show all
Defined in:
lib/tacape/belt.rb

Class Method Summary collapse

Class Method Details

.current_osObject

Returns the current OS class



13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
# File 'lib/tacape/belt.rb', line 13

def self.current_os
  current_os=:unknown
  current_os=self.os_families[:mac][:osx] if OS.osx?
  current_os=self.os_families[:msoft][:windows] if OS.windows?
  if OS.linux?
    Belt.os_families[:linux].each do |k,v|
      current_os=v.identify if v.identify!=nil
    end
  end
  if current_os==nil
    raise OSLayerNotImplemented, "Sorry, no goodies for you for now, we only support there OSes:\n#{Tacape::Belt.os_families}"
  else
    return current_os
  end
end

.os_familiesObject



7
8
9
10
# File 'lib/tacape/belt.rb', line 7

def self.os_families
  #msoft: [windows: Windows]
  {:mac=> {:osx=>Tacape::Os::Osx}, :linux=> {:fedora=>Tacape::Os::Fedora}}
end