summaryrefslogtreecommitdiff
path: root/spec/support/platform_helpers.rb
diff options
context:
space:
mode:
authorThom May <thom@chef.io>2016-01-14 14:08:03 +0000
committerThom May <thom@chef.io>2016-01-14 14:08:03 +0000
commit51cfbdc4d16739caac4d946fadbe678444aafe34 (patch)
tree56dfd8f1cd9fd933de27268b32402e955a43ac2b /spec/support/platform_helpers.rb
parent05064423057d4cf46f4713b81b08829cf6d20af6 (diff)
downloadchef-51cfbdc4d16739caac4d946fadbe678444aafe34.tar.gz
Use double quotes by default
This is an entirely mechanically generated (chefstyle -a) change, to go along with chef/chefstyle#5 . We should pick something and use it consistently, and my opinion is that double quotes are the appropriate thing.
Diffstat (limited to 'spec/support/platform_helpers.rb')
-rw-r--r--spec/support/platform_helpers.rb40
1 files changed, 20 insertions, 20 deletions
diff --git a/spec/support/platform_helpers.rb b/spec/support/platform_helpers.rb
index e80df90499..0259dc6dfb 100644
--- a/spec/support/platform_helpers.rb
+++ b/spec/support/platform_helpers.rb
@@ -1,6 +1,6 @@
-require 'fcntl'
-require 'chef/mixin/shell_out'
-require 'ohai/mixin/gce_metadata'
+require "fcntl"
+require "chef/mixin/shell_out"
+require "ohai/mixin/gce_metadata"
class ShellHelpers
extend Chef::Mixin::ShellOut
@@ -11,11 +11,11 @@ def ruby_lt_20?
end
def chef_gte_13?
- Chef::VERSION.split('.').first.to_i >= 13
+ Chef::VERSION.split(".").first.to_i >= 13
end
def chef_lt_13?
- Chef::VERSION.split('.').first.to_i < 13
+ Chef::VERSION.split(".").first.to_i < 13
end
def ruby_gte_19?
@@ -27,11 +27,11 @@ def ruby_20?
end
def ruby_64bit?
- !!(RbConfig::CONFIG['host_cpu'] =~ /x86_64/)
+ !!(RbConfig::CONFIG["host_cpu"] =~ /x86_64/)
end
def ruby_32bit?
- !!(RbConfig::CONFIG['host_cpu'] =~ /i686/)
+ !!(RbConfig::CONFIG["host_cpu"] =~ /i686/)
end
def windows?
@@ -43,29 +43,29 @@ def ohai
OHAI_SYSTEM
end
-require 'wmi-lite/wmi' if windows?
+require "wmi-lite/wmi" if windows?
def windows_domain_joined?
return false unless windows?
wmi = WmiLite::Wmi.new
- computer_system = wmi.first_of('Win32_ComputerSystem')
- computer_system['partofdomain']
+ computer_system = wmi.first_of("Win32_ComputerSystem")
+ computer_system["partofdomain"]
end
def windows_win2k3?
return false unless windows?
wmi = WmiLite::Wmi.new
- host = wmi.first_of('Win32_OperatingSystem')
- (host['version'] && host['version'].start_with?("5.2"))
+ host = wmi.first_of("Win32_OperatingSystem")
+ (host["version"] && host["version"].start_with?("5.2"))
end
def windows_2008r2_or_later?
return false unless windows?
wmi = WmiLite::Wmi.new
- host = wmi.first_of('Win32_OperatingSystem')
- version = host['version']
+ host = wmi.first_of("Win32_OperatingSystem")
+ version = host["version"]
return false unless version
- components = version.split('.').map do | component |
+ components = version.split(".").map do | component |
component.to_i
end
components.length >=2 && components[0] >= 6 && components[1] >= 1
@@ -75,7 +75,7 @@ def windows_powershell_dsc?
return false unless windows?
supports_dsc = false
begin
- wmi = WmiLite::Wmi.new('root/microsoft/windows/desiredstateconfiguration')
+ wmi = WmiLite::Wmi.new("root/microsoft/windows/desiredstateconfiguration")
lcm = wmi.query("SELECT * FROM meta_class WHERE __this ISA 'MSFT_DSCLocalConfigurationManager'")
supports_dsc = !! lcm
rescue WmiLite::WmiException
@@ -84,7 +84,7 @@ def windows_powershell_dsc?
end
def windows_nano_server?
- require 'chef/platform/query_helpers'
+ require "chef/platform/query_helpers"
Chef::Platform.windows_nano_server?
end
@@ -117,7 +117,7 @@ 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' )
+ windows? && ( ENV["PROCESSOR_ARCHITECTURE"] == "AMD64" || ENV["PROCESSOR_ARCHITEW6432"] == "AMD64" )
end
# detects if the hardware is 32-bit
@@ -156,10 +156,10 @@ def wpar?
end
def supports_cloexec?
- Fcntl.const_defined?('F_SETFD') && Fcntl.const_defined?('FD_CLOEXEC')
+ Fcntl.const_defined?("F_SETFD") && Fcntl.const_defined?("FD_CLOEXEC")
end
-DEV_NULL = windows? ? 'NUL' : '/dev/null'
+DEV_NULL = windows? ? "NUL" : "/dev/null"
def selinux_enabled?
# This code is currently copied from lib/chef/util/selinux to make