Module: Jekyll::Utils::Platforms

Extended by:
Platforms
Included in:
Platforms
Defined in:
lib/jekyll/utils/platforms.rb

Instance Method Summary collapse

Instance Method Details

#bash_on_windows?Boolean

Returns:

  • (Boolean)


38
39
40
41
# File 'lib/jekyll/utils/platforms.rb', line 38

def bash_on_windows?
  RbConfig::CONFIG["host_os"] =~ %r!linux! && \
    proc_version =~ %r!microsoft!i
end

#linux?Boolean

Returns:

  • (Boolean)


51
52
53
54
# File 'lib/jekyll/utils/platforms.rb', line 51

def linux?
  RbConfig::CONFIG["host_os"] =~ %r!linux! && \
    proc_version !~ %r!microsoft!i
end

#vanilla_windows?Boolean Also known as: really_windows?

– Allows you to detect “real” Windows, or what we would consider “real” Windows. That is, that we can pass the basic test and the /proc/version returns nothing to us. –

Returns:

  • (Boolean)


24
25
26
27
# File 'lib/jekyll/utils/platforms.rb', line 24

def vanilla_windows?
  RbConfig::CONFIG["host_os"] =~ %r!mswin|mingw|cygwin!i && \
    !proc_version
end

#windows?Boolean

Returns:

  • (Boolean)


45
46
47
# File 'lib/jekyll/utils/platforms.rb', line 45

def windows?
  vanilla_windows? || bash_on_windows?
end