Sha256: 29485524b56d6eb903e8109b37a14a4b4be1b7c5cbc6cd7365187b7f0d620444

Contents?: true

Size: 588 Bytes

Versions: 133

Compression:

Stored size: 588 Bytes

Contents

module Origen
  # Provides methods to detect the operating system used at runtime, an instance of
  # this class is automatically instantiated as Origen.os.
  #
  # @example
  #   Origen.os.windows?   # => false
  #   Origen.os.linux?     # => true
  class OperatingSystems
    def windows?
      !!(RUBY_PLATFORM =~ /cygwin|mswin|mingw|bccwin|wince|emx/)
    end

    def mac?
      !!(RUBY_PLATFORM =~ /darwin/)
    end

    def linux?
      !windows? && !mac?
    end

    def unix?
      !windows?
    end
  end
  def self.os
    @operating_systems ||= OperatingSystems.new
  end
end

Version data entries

133 entries across 133 versions & 1 rubygems

Version Path
origen-0.38.0 lib/origen/operating_systems.rb
origen-0.37.0 lib/origen/operating_systems.rb
origen-0.36.1 lib/origen/operating_systems.rb
origen-0.36.0 lib/origen/operating_systems.rb
origen-0.35.1 lib/origen/operating_systems.rb
origen-0.35.0 lib/origen/operating_systems.rb
origen-0.34.3 lib/origen/operating_systems.rb
origen-0.34.2 lib/origen/operating_systems.rb
origen-0.34.1 lib/origen/operating_systems.rb
origen-0.34.0 lib/origen/operating_systems.rb
origen-0.33.3 lib/origen/operating_systems.rb
origen-0.33.2 lib/origen/operating_systems.rb
origen-0.33.1 lib/origen/operating_systems.rb
origen-0.33.0 lib/origen/operating_systems.rb
origen-0.32.1 lib/origen/operating_systems.rb
origen-0.32.0 lib/origen/operating_systems.rb
origen-0.31.0 lib/origen/operating_systems.rb
origen-0.30.0 lib/origen/operating_systems.rb
origen-0.29.0 lib/origen/operating_systems.rb
origen-0.28.2 lib/origen/operating_systems.rb