Sha256: f4d76fe7aebe1c8d851e802bc4ab7e10838f68533d7c8cfac02f1bda6eae3295

Contents?: true

Size: 606 Bytes

Versions: 12

Compression:

Stored size: 606 Bytes

Contents

require 'rbconfig'

module Chozo
  # @author Jamie Winsor <jamie@vialstudios.com>
  module Platform
    module ClassMethods
      # @return [Boolean]
      def windows?
        (RbConfig::CONFIG['host_os'] =~ /mswin|mingw|cygwin/) ? true : false
      end

      def osx?
        (RbConfig::CONFIG['host_os'] =~ /darwin/) ? true : false
      end

      def linux?
        (RbConfig::CONFIG['host_os'] =~ /linux/) ? true : false
      end
    end

    class << self
      def included(base)
        base.send(:include, Platform::ClassMethods)
      end
    end

    extend Platform::ClassMethods
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
chozo-0.6.1 lib/chozo/platform.rb
chozo-0.6.0 lib/chozo/platform.rb
chozo-0.5.0 lib/chozo/platform.rb
chozo-0.4.2 lib/chozo/platform.rb
chozo-0.4.1 lib/chozo/platform.rb
chozo-0.4.0 lib/chozo/platform.rb
chozo-0.3.0 lib/chozo/platform.rb
chozo-0.2.3 lib/chozo/platform.rb
chozo-0.2.2 lib/chozo/platform.rb
chozo-0.2.1 lib/chozo/platform.rb
chozo-0.2.0 lib/chozo/platform.rb
chozo-0.1.0 lib/chozo/platform.rb