Sha256: 192532db80d4d8ab46efe17a723ce1a656bb46bf1bc8b8621e50012d35d99cbc

Contents?: true

Size: 687 Bytes

Versions: 14

Compression:

Stored size: 687 Bytes

Contents

require 'rbconfig'

#Shameless copy of Vagrant code
module Mccloud
  module Util
    # This class just contains some platform checking code.
    class Platform
      class << self
        def tiger?
          platform.include?("darwin8")
        end

        def leopard?
          platform.include?("darwin9")
        end

        def windows?
          platform.include?("mswin") || platform.include?("mingw")
        end

        [:darwin, :bsd, :linux].each do |type|
          define_method("#{type}?") do
            platform.include?(type.to_s)
          end
        end

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

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
mccloud-0.1.1 lib/mccloud/util/platform.rb
mccloud-0.0.28 lib/mccloud/util/platform.rb
mccloud-0.0.27 lib/mccloud/util/platform.rb
mccloud-0.0.26 lib/mccloud/util/platform.rb
mccloud-0.0.25 lib/mccloud/util/platform.rb
mccloud-0.0.24 lib/mccloud/util/platform.rb
mccloud-0.0.23 lib/mccloud/util/platform.rb
mccloud-0.0.22 lib/mccloud/util/platform.rb
mccloud-0.0.21 lib/mccloud/util/platform.rb
mccloud-0.0.20 lib/mccloud/util/platform.rb
mccloud-0.0.19 lib/mccloud/util/platform.rb
mccloud-0.0.18 lib/mccloud/util/platform.rb
mccloud-0.0.17 lib/mccloud/util/platform.rb
mccloud-0.0.16 lib/mccloud/util/platform.rb