module R10K::Util::Platform

Constants

FIPS_FILE

Public Class Methods

fips?() click to toggle source

We currently only suport FIPS mode on redhat 7, where it is toggled via a file.

# File lib/r10k/util/platform.rb, line 21
def self.fips?
  if File.exist?(FIPS_FILE)
    File.read(FIPS_FILE).chomp == "1"
  else
    false
  end
end
jruby?() click to toggle source
# File lib/r10k/util/platform.rb, line 33
def self.jruby?
  RUBY_PLATFORM == "java"
end
platform() click to toggle source
# File lib/r10k/util/platform.rb, line 8
def self.platform
  # Test JRuby first to handle JRuby on Windows as well.
  if self.jruby?
    :jruby
  elsif self.windows?
    :windows
  else
    :posix
  end
end
posix?() click to toggle source
# File lib/r10k/util/platform.rb, line 37
def self.posix?
  !windows? && !jruby?
end
windows?() click to toggle source
# File lib/r10k/util/platform.rb, line 29
def self.windows?
  RbConfig::CONFIG['host_os'] =~ /mswin|win32|dos|mingw|cygwin/i
end