module Jekyll::Utils::Platforms

Public Instance Methods

bash_on_windows?() click to toggle source
# File lib/ngage/jekyll/utils/platforms.rb, line 38
def bash_on_windows?
  RbConfig::CONFIG["host_os"] =~ %r!linux! && \
    proc_version =~ %r!microsoft!i
end
linux?() click to toggle source
# File lib/ngage/jekyll/utils/platforms.rb, line 51
def linux?
  RbConfig::CONFIG["host_os"] =~ %r!linux! && \
    proc_version !~ %r!microsoft!i
end
really_windows?()

– XXX: Remove in 4.0 –

Alias for: vanilla_windows?
vanilla_windows?() click to toggle source

– 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. –

# File lib/ngage/jekyll/utils/platforms.rb, line 24
def vanilla_windows?
  RbConfig::CONFIG["host_os"] =~ %r!mswin|mingw|cygwin!i && \
    !proc_version
end
Also aliased as: really_windows?
windows?() click to toggle source
# File lib/ngage/jekyll/utils/platforms.rb, line 45
def windows?
  vanilla_windows? || bash_on_windows?
end

Private Instance Methods

proc_version() click to toggle source
# File lib/ngage/jekyll/utils/platforms.rb, line 72
def proc_version
  @proc_version ||=
    begin
      Pathutil.new("/proc/version").read
    rescue Errno::ENOENT, Errno::EACCES
      nil
    end
end