Sha256: 7c13ba60186f72e6051c8ba789feb00902cafd36d91a6d441690b45214b7a2e6

Contents?: true

Size: 917 Bytes

Versions: 3

Compression:

Stored size: 917 Bytes

Contents

module Jekyll
  module Utils
    module Platforms
      extend self

      # Provides jruby? and mri? which respectively detect these two types of
      # tested Engines we support, in the future we might probably support the
      # other one that everyone used to talk about.

      { :jruby? => "jruby", :mri? => "ruby" }.each do |k, v|
        define_method k do
          ::RUBY_ENGINE == v
        end
      end

      # Provides windows?, linux?, osx?, unix? so that we can detect
      # platforms. This is mostly useful for `jekyll doctor` and for testing
      # where we kick off certain tests based on the platform.

      { :windows? => %r!mswin|mingw|cygwin!, :linux? => %r!linux!, \
          :osx? => %r!darwin|mac os!, :unix? => %r!solaris|bsd! }.each do |k, v|
        define_method k do
          !!(
            RbConfig::CONFIG["host_os"] =~ v
          )
        end
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
jekyll-3.2.1 lib/jekyll/utils/platforms.rb
jekyll-3.2.0 lib/jekyll/utils/platforms.rb
jekyll-3.2.0.pre.beta2 lib/jekyll/utils/platforms.rb