Sha256: 8e9f8d8d610e39876da25a714edd91345697045e4f9da60e5076566aa8fb9ae6
Contents?: true
Size: 586 Bytes
Versions: 9
Compression:
Stored size: 586 Bytes
Contents
# Copyright (C) 2012 Sourcefire, Inc. module Panoptimon module Util VERSION = '0.0.1' def self._os; @os ||= Gem::Platform.local.os.to_sym; end # return osname # or, given a hash, return the corresponding hash element and raise # error if os not in hash keys def self.os (dispatch={}) # TODO or mess with rbconfig + Config::CONFIG['host_os'] os = _os return os unless dispatch.length > 0 it = dispatch[os] || dispatch[:default] or raise "unsupported OS: #{os}" return it.is_a?(Proc) ? it.call() : it end end end
Version data entries
9 entries across 9 versions & 1 rubygems