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.7.9 lib/origen/operating_systems.rb
origen-0.7.8 lib/origen/operating_systems.rb
origen-0.7.7 lib/origen/operating_systems.rb
origen-0.7.6 lib/origen/operating_systems.rb
origen-0.7.5 lib/origen/operating_systems.rb
origen-0.7.4 lib/origen/operating_systems.rb
origen-0.7.3 lib/origen/operating_systems.rb
origen-0.7.2 lib/origen/operating_systems.rb
origen-0.7.1 lib/origen/operating_systems.rb
origen-0.7.0 lib/origen/operating_systems.rb
origen-0.6.12 lib/origen/operating_systems.rb
origen-0.6.11 lib/origen/operating_systems.rb
origen-0.6.10 lib/origen/operating_systems.rb
origen-0.6.9 lib/origen/operating_systems.rb
origen-0.6.8 lib/origen/operating_systems.rb
origen-0.6.7 lib/origen/operating_systems.rb
origen-0.6.6 lib/origen/operating_systems.rb
origen-0.6.5 lib/origen/operating_systems.rb
origen-0.6.4 lib/origen/operating_systems.rb
origen-0.6.3 lib/origen/operating_systems.rb