Sha256: 9ce4bf6b6517e8824448a872c28457f5672c83adce50960030eb7b6c8894a8b7

Contents?: true

Size: 880 Bytes

Versions: 18

Compression:

Stored size: 880 Bytes

Contents

def ruby_19?
  !!(RUBY_VERSION =~ /^1.9/)
end

def ruby_18?
  !!(RUBY_VERSION =~ /^1.8/)
end

def windows?
  !!(RUBY_PLATFORM =~ /mswin|mingw|windows/)
end

def windows_win2k3?
  return false unless windows?
  require 'ruby-wmi'

  host = WMI::Win32_OperatingSystem.find(:first)
  (host.version && host.version.start_with?("5.2"))
end

# detects if the hardware is 64-bit (evaluates to true in "WOW64" mode in a 32-bit app on a 64-bit system)
def windows64?
  windows? && ( ENV['PROCESSOR_ARCHITECTURE'] == 'AMD64' || ENV['PROCESSOR_ARCHITEW6432'] == 'AMD64' )
end

# detects if the hardware is 32-bit
def windows32?
  windows? && !windows64?
end

# def jruby?

def unix?
  !windows?
end

def os_x?
  !!(RUBY_PLATFORM =~ /darwin/)
end

def solaris?
  !!(RUBY_PLATFORM =~ /solaris/)
end

def freebsd?
  !!(RUBY_PLATFORM =~ /freebsd/)
end

DEV_NULL = windows? ? 'NUL' : '/dev/null'

Version data entries

18 entries across 18 versions & 2 rubygems

Version Path
chef-11.4.4 spec/support/platform_helpers.rb
chef-11.4.2 spec/support/platform_helpers.rb
microwave-11.400.8 spec/support/platform_helpers.rb
microwave-11.400.7 spec/support/platform_helpers.rb
microwave-11.400.6 spec/support/platform_helpers.rb
microwave-11.400.5 spec/support/platform_helpers.rb
microwave-11.400.4 spec/support/platform_helpers.rb
microwave-11.400.3 spec/support/platform_helpers.rb
microwave-11.400.2 spec/support/platform_helpers.rb
chef-11.4.0 spec/support/platform_helpers.rb
chef-11.4.0.rc.0 spec/support/platform_helpers.rb
chef-11.0.0.beta.2 spec/support/platform_helpers.rb
chef-11.2.0 spec/support/platform_helpers.rb
chef-11.2.0.rc.1 spec/support/platform_helpers.rb
chef-11.0.0 spec/support/platform_helpers.rb
chef-11.0.0.rc.0 spec/support/platform_helpers.rb
chef-11.0.0.beta.1 spec/support/platform_helpers.rb
chef-11.0.0.beta.0 spec/support/platform_helpers.rb