Sha256: 14191b1b42686b4cbf863b1a7b77028d4562dbdb78009f85a4915458cc5615c5

Contents?: true

Size: 461 Bytes

Versions: 22

Compression:

Stored size: 461 Bytes

Contents

module Buildbox
  class Platform
    class << self
      [:cygwin, :darwin, :bsd, :freebsd, :linux, :solaris].each do |type|
        define_method("#{type}?") do
          platform.include?(type.to_s)
        end
      end

      def windows?
        %W[mingw mswin].each do |text|
          return true if platform.include?(text)
        end

        false
      end

      def platform
        RbConfig::CONFIG["host_os"].downcase
      end
    end
  end
end

Version data entries

22 entries across 22 versions & 1 rubygems

Version Path
buildbox-0.3.1 lib/buildbox/platform.rb
buildbox-0.3 lib/buildbox/platform.rb