Module: R10K::Util::Platform

Defined in:
lib/r10k/util/platform.rb

Class Method Summary collapse

Class Method Details

.jruby?Boolean

Returns:

  • (Boolean)


21
22
23
# File 'lib/r10k/util/platform.rb', line 21

def self.jruby?
  RUBY_PLATFORM == "java"
end

.platformObject



6
7
8
9
10
11
12
13
14
15
# File 'lib/r10k/util/platform.rb', line 6

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

Returns:

  • (Boolean)


25
26
27
# File 'lib/r10k/util/platform.rb', line 25

def self.posix?
  !windows? && !jruby?
end

.windows?Boolean

Returns:

  • (Boolean)


17
18
19
# File 'lib/r10k/util/platform.rb', line 17

def self.windows?
  RbConfig::CONFIG['host_os'] =~ /mswin|win32|dos|mingw|cygwin/i
end