Sha256: ea30c61bb6037f15032a142519f0e763ba918b23e2be535c0b7cae85076b1d16

Contents?: true

Size: 568 Bytes

Versions: 22

Compression:

Stored size: 568 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

# 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

22 entries across 22 versions & 1 rubygems

Version Path
chef-10.28.2 spec/support/platform_helpers.rb
chef-10.28.2-x86-mingw32 spec/support/platform_helpers.rb
chef-10.28.0 spec/support/platform_helpers.rb
chef-10.28.0.rc.0 spec/support/platform_helpers.rb
chef-10.26.0 spec/support/platform_helpers.rb
chef-10.26.0.beta.0 spec/support/platform_helpers.rb
chef-10.24.4 spec/support/platform_helpers.rb
chef-10.24.0 spec/support/platform_helpers.rb
chef-10.24.0.rc.2 spec/support/platform_helpers.rb
chef-10.24.0.rc.1 spec/support/platform_helpers.rb
chef-10.24.0.rc.0 spec/support/platform_helpers.rb
chef-10.22.0 spec/support/platform_helpers.rb
chef-10.22.0.rc.0 spec/support/platform_helpers.rb
chef-10.20.0 spec/support/platform_helpers.rb
chef-10.18.4.rc.2 spec/support/platform_helpers.rb
chef-10.18.4.rc.1 spec/support/platform_helpers.rb
chef-10.18.2 spec/support/platform_helpers.rb
chef-10.18.0 spec/support/platform_helpers.rb
chef-10.18.0.rc.2 spec/support/platform_helpers.rb
chef-10.16.6 spec/support/platform_helpers.rb