summaryrefslogtreecommitdiff
path: root/lib/chef/util/powershell
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 /lib/chef/util/powershell
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 'lib/chef/util/powershell')
-rw-r--r--lib/chef/util/powershell/cmdlet.rb22
-rw-r--r--lib/chef/util/powershell/cmdlet_result.rb2
-rw-r--r--lib/chef/util/powershell/ps_credential.rb2
3 files changed, 13 insertions, 13 deletions
diff --git a/lib/chef/util/powershell/cmdlet.rb b/lib/chef/util/powershell/cmdlet.rb
index 7eab098c83..6d9bd67afa 100644
--- a/lib/chef/util/powershell/cmdlet.rb
+++ b/lib/chef/util/powershell/cmdlet.rb
@@ -16,9 +16,9 @@
# limitations under the License.
#
-require 'mixlib/shellout'
-require 'chef/mixin/windows_architecture_helper'
-require 'chef/util/powershell/cmdlet_result'
+require "mixlib/shellout"
+require "chef/mixin/windows_architecture_helper"
+require "chef/util/powershell/cmdlet_result"
class Chef
class Util
@@ -48,11 +48,11 @@ class Powershell
attr_reader :output_format
def run(switches={}, execution_options={}, *arguments)
- streams = { :json => CmdletStream.new('json'),
- :verbose => CmdletStream.new('verbose'),
+ streams = { :json => CmdletStream.new("json"),
+ :verbose => CmdletStream.new("verbose"),
}
- arguments_string = arguments.join(' ')
+ arguments_string = arguments.join(" ")
switches_string = command_switches_string(switches)
@@ -119,7 +119,7 @@ class Powershell
validate_switch_name!(switch_name)
- switch_argument = ''
+ switch_argument = ""
switch_present = true
case switch_value
@@ -136,10 +136,10 @@ class Powershell
raise ArgumentError, "Invalid argument type `#{switch_value.class}` specified for PowerShell switch `:#{switch_name}`. Arguments to PowerShell must be of type `String`, `Numeric`, `Float`, `FalseClass`, or `TrueClass`"
end
- switch_present ? ["-#{switch_name.to_s.downcase}", switch_argument].join(' ').strip : ''
+ switch_present ? ["-#{switch_name.to_s.downcase}", switch_argument].join(" ").strip : ""
end
- command_switches.join(' ')
+ command_switches.join(" ")
end
class CmdletStream
@@ -154,8 +154,8 @@ class Powershell
def read
if File.exist? @filename
- File.open(@filename, 'rb:bom|UTF-16LE') do |f|
- f.read.encode('UTF-8')
+ File.open(@filename, "rb:bom|UTF-16LE") do |f|
+ f.read.encode("UTF-8")
end
end
end
diff --git a/lib/chef/util/powershell/cmdlet_result.rb b/lib/chef/util/powershell/cmdlet_result.rb
index f1fdd968b1..531636a4ff 100644
--- a/lib/chef/util/powershell/cmdlet_result.rb
+++ b/lib/chef/util/powershell/cmdlet_result.rb
@@ -16,7 +16,7 @@
# limitations under the License.
#
-require 'chef/json_compat'
+require "chef/json_compat"
class Chef
class Util
diff --git a/lib/chef/util/powershell/ps_credential.rb b/lib/chef/util/powershell/ps_credential.rb
index 2fc0650e5f..660ef32472 100644
--- a/lib/chef/util/powershell/ps_credential.rb
+++ b/lib/chef/util/powershell/ps_credential.rb
@@ -16,7 +16,7 @@
# limitations under the License.
#
-require 'chef/win32/crypto' if Chef::Platform.windows?
+require "chef/win32/crypto" if Chef::Platform.windows?
class Chef::Util::Powershell
class PSCredential