Sha256: 0f6f654b1593fb8f2d4066b160f041d70e6dfd9135a1babf5f0a2f76c5cf97c6

Contents?: true

Size: 839 Bytes

Versions: 3

Compression:

Stored size: 839 Bytes

Contents

module Tacape
  load "tacape/oses/osx.rb"
  load "tacape/oses/fedora.rb"
  load "tacape/oses/os_exceptions.rb"

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

    #Returns the current OS class
    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

  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
tacape-0.0.6 lib/tacape/belt.rb
tacape-0.0.4 lib/tacape/belt.rb
tacape-0.0.3 lib/tacape/belt.rb