module Jekyll::Utils::Platforms
Public Instance Methods
bash_on_windows?()
click to toggle source
# 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?()
click to toggle source
# File lib/jekyll/utils/platforms.rb, line 51 def linux? RbConfig::CONFIG["host_os"] =~ %r!linux! && \ proc_version !~ %r!microsoft!i end
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/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/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/jekyll/utils/platforms.rb, line 72 def proc_version @proc_version ||= begin File.read("/proc/version") rescue Errno::ENOENT, Errno::EACCES nil end end