Sha256: 3538e36fe8124216350052980257421a37c579e7c6c3ef97e25c388719d92ea9

Contents?: true

Size: 1.32 KB

Versions: 13

Compression:

Stored size: 1.32 KB

Contents

module SifttterRedux
  #  ======================================================
  #  OS Module
  #
  #  Module to easily find the running operating system
  #  ======================================================
  module OS
    #  ----------------------------------------------------
    #  linux? method
    #
    #  Returns true if the host OS is Linux.
    #  @return Bool
    #  ----------------------------------------------------
    def OS.linux?
      self.unix? and not self.mac?
    end

    #  ----------------------------------------------------
    #  mac? method
    #
    #  Returns true if the host OS is OS X.
    #  @return Bool
    #  ----------------------------------------------------
    def OS.mac?
      !(/darwin/ =~ RUBY_PLATFORM).nil?
    end

    #  ----------------------------------------------------
    #  unix? method
    #
    #  Returns true if the host OS is Unix.
    #  @return Bool
    #  ----------------------------------------------------
    def OS.unix?
      !self.windows?
    end

    #  ----------------------------------------------------
    #  windows? method
    #
    #  Returns true if the host OS is Windows
    #  @return Bool
    #  ----------------------------------------------------
    def OS.windows?
      !(/cygwin|mswin|mingw|bccwin|wince|emx/ =~ RUBY_PLATFORM).nil?
    end
  end
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
sifttter-redux-0.4.4 lib/sifttter_redux/os.rb
sifttter-redux-0.4.3 lib/sifttter_redux/os.rb
sifttter-redux-0.4.2 lib/sifttter_redux/os.rb
sifttter-redux-0.4.1 lib/sifttter_redux/os.rb
sifttter-redux-0.4.0 lib/sifttter_redux/os.rb
sifttter-redux-0.3.9 lib/sifttter_redux/os.rb
sifttter-redux-0.3.8 lib/sifttter_redux/os.rb
sifttter-redux-0.3.7 lib/sifttter_redux/os.rb
sifttter-redux-0.3.6 lib/sifttter_redux/os.rb
sifttter-redux-0.3.5 lib/sifttter_redux/os.rb
sifttter-redux-0.3.4 lib/sifttter_redux/os.rb
sifttter-redux-0.3.3 lib/sifttter_redux/os.rb
sifttter-redux-0.3.2 lib/sifttter_redux/os.rb