summaryrefslogtreecommitdiff
path: root/lib/chef/util
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
parent0944320b72ee1ab16a18a149f5ecb743ace0c0d3 (diff)
downloadchef-c844e1c87374b18ee634a06a5325518631607c90.tar.gz
chefstyle: fix Lint/StringConversionInInterpolation
useless use of `"#{foo.to_s}"`
Diffstat (limited to 'lib/chef/util')
-rw-r--r--lib/chef/util/dsc/configuration_generator.rb2
-rw-r--r--lib/chef/util/powershell/cmdlet.rb6
2 files changed, 4 insertions, 4 deletions
diff --git a/lib/chef/util/dsc/configuration_generator.rb b/lib/chef/util/dsc/configuration_generator.rb
index 0d7296eae9..2041278e4a 100644
--- a/lib/chef/util/dsc/configuration_generator.rb
+++ b/lib/chef/util/dsc/configuration_generator.rb
@@ -72,7 +72,7 @@ class Chef::Util::DSC
if configuration_flags
configuration_flags.map do | switch, value |
if merged_configuration_flags.key?(switch.to_s.downcase.to_sym)
- raise ArgumentError, "The `flags` attribute for the dsc_script resource contained a command line switch :#{switch.to_s} that is disallowed."
+ raise ArgumentError, "The `flags` attribute for the dsc_script resource contained a command line switch :#{switch} that is disallowed."
end
merged_configuration_flags[switch.to_s.downcase.to_sym] = value
end
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 : ''