Module: R10K::Util::Platform
- Defined in:
- lib/r10k/util/platform.rb
Constant Summary collapse
- FIPS_FILE =
"/proc/sys/crypto/fips_enabled"
Class Method Summary collapse
-
.fips? ⇒ Boolean
We currently only suport FIPS mode on redhat 7, where it is toggled via a file.
- .jruby? ⇒ Boolean
- .platform ⇒ Object
- .posix? ⇒ Boolean
- .windows? ⇒ Boolean
Class Method Details
.fips? ⇒ Boolean
We currently only suport FIPS mode on redhat 7, where it is toggled via a file.
21 22 23 24 25 26 27 |
# 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? ⇒ Boolean
33 34 35 |
# File 'lib/r10k/util/platform.rb', line 33 def self.jruby? RUBY_PLATFORM == "java" end |
.platform ⇒ Object
8 9 10 11 12 13 14 15 16 17 |
# 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? ⇒ Boolean
37 38 39 |
# File 'lib/r10k/util/platform.rb', line 37 def self.posix? !windows? && !jruby? end |
.windows? ⇒ Boolean
29 30 31 |
# File 'lib/r10k/util/platform.rb', line 29 def self.windows? RbConfig::CONFIG['host_os'] =~ /mswin|win32|dos|mingw|cygwin/i end |