summaryrefslogtreecommitdiff
path: root/lib/chef/util/powershell/cmdlet.rb
diff options
context:
space:
mode:
authorLamont Granquist <lamont@scriptkiddie.org>2016-01-12 08:22:09 -0800
committerLamont Granquist <lamont@scriptkiddie.org>2016-01-12 08:22:09 -0800
commitc844e1c87374b18ee634a06a5325518631607c90 (patch)
tree59526dce9d78c30e40282e595d914cf703858663 /lib/chef/util/powershell/cmdlet.rb
parent0944320b72ee1ab16a18a149f5ecb743ace0c0d3 (diff)
downloadchef-c844e1c87374b18ee634a06a5325518631607c90.tar.gz
chefstyle: fix Lint/StringConversionInInterpolation
useless use of `"#{foo.to_s}"`
Diffstat (limited to 'lib/chef/util/powershell/cmdlet.rb')
-rw-r--r--lib/chef/util/powershell/cmdlet.rb6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/chef/util/powershell/cmdlet.rb b/lib/chef/util/powershell/cmdlet.rb
index 47d63a2b85..7eab098c83 100644
--- a/lib/chef/util/powershell/cmdlet.rb
+++ b/lib/chef/util/powershell/cmdlet.rb
@@ -38,7 +38,7 @@ class Powershell
when :object
@json_format = true
else
- raise ArgumentError, "Invalid output format #{output_format.to_s} specified"
+ raise ArgumentError, "Invalid output format #{output_format} specified"
end
@cmdlet = cmdlet
@@ -114,7 +114,7 @@ class Powershell
def command_switches_string(switches)
command_switches = switches.map do | switch_name, switch_value |
if switch_name.class != Symbol
- raise ArgumentError, "Invalid type `#{switch_name} `for PowerShell switch '#{switch_name.to_s}'. The switch must be specified as a Symbol'"
+ raise ArgumentError, "Invalid type `#{switch_name} `for PowerShell switch '#{switch_name}'. The switch must be specified as a Symbol'"
end
validate_switch_name!(switch_name)
@@ -133,7 +133,7 @@ class Powershell
when String
switch_argument = escape_string_parameter_value(switch_value)
else
- raise ArgumentError, "Invalid argument type `#{switch_value.class}` specified for PowerShell switch `:#{switch_name.to_s}`. Arguments to PowerShell must be of type `String`, `Numeric`, `Float`, `FalseClass`, or `TrueClass`"
+ 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 : ''