Sha256: 753762a8e9611be3a356d1d37dc88f96e2c9984fab7f71e3dd49a0a5aec71f1a
Contents?: true
Size: 635 Bytes
Versions: 6
Compression:
Stored size: 635 Bytes
Contents
require 'rbconfig' module Overcommit # Methods relating to the current operating system module OS class << self def windows? !(/mswin|msys|mingw|bccwin|wince|emc/ =~ host_os).nil? end def cygwin? !(/cygwin/ =~ host_os).nil? end def mac? !(/darwin|mac os/ =~ host_os).nil? end def unix? !windows? end def linux? unix? && !mac? && !cygwin? end private def host_os @host_os ||= ::RbConfig::CONFIG['host_os'].freeze end end SEPARATOR = (windows? ? '\\' : File::SEPARATOR).freeze end end
Version data entries
6 entries across 4 versions & 2 rubygems