Sha256: bb511ba7ff5b6088f3571e03884241ae97b086407b61846159fd6ca07b61f481

Contents?: true

Size: 904 Bytes

Versions: 13

Compression:

Stored size: 904 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? => /mswin|mingw|cygwin/, :linux? => /linux/, \
          :osx? => /darwin|mac os/, :unix? => /solaris|bsd/ }.each do |k, v|

        define_method k do
          !!(
            RbConfig::CONFIG["host_os"] =~ v
          )
        end
      end
    end
  end
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
jekyll-3.0.5 lib/jekyll/utils/platforms.rb
jekyll-3.0.4 lib/jekyll/utils/platforms.rb
jekyll-3.0.3 lib/jekyll/utils/platforms.rb
jekyll-3.0.2 lib/jekyll/utils/platforms.rb
jekyll-3.0.1 lib/jekyll/utils/platforms.rb
jekyll-3.0.0 lib/jekyll/utils/platforms.rb
jekyll-3.0.0.pre.rc1 lib/jekyll/utils/platforms.rb
jekyll-3.0.0.pre.beta10 lib/jekyll/utils/platforms.rb
jekyll-3.0.0.pre.beta9 lib/jekyll/utils/platforms.rb
jekyll-3.0.0.pre.beta8 lib/jekyll/utils/platforms.rb
jekyll-3.0.0.pre.beta7 lib/jekyll/utils/platforms.rb
jekyll-3.0.0.pre.beta6 lib/jekyll/utils/platforms.rb
jekyll-3.0.0.pre.beta5 lib/jekyll/utils/platforms.rb