From 8017ab003cff28c49e7ed982efda34daf28b9590 Mon Sep 17 00:00:00 2001 From: Tim Smith Date: Sat, 26 Dec 2020 10:35:00 -0800 Subject: Remove redundant arguments to join methods There's no point in specifying the argument here. Signed-off-by: Tim Smith --- lib/chef/formatters/error_inspectors/compile_error_inspector.rb | 2 +- lib/chef/formatters/error_inspectors/resource_failure_inspector.rb | 2 +- lib/chef/http/socketless_chef_zero_client.rb | 2 +- lib/chef/provider/mount/solaris.rb | 2 +- lib/chef/provider/service/redhat.rb | 4 ++-- lib/chef/resource/swap_file.rb | 2 +- 6 files changed, 7 insertions(+), 7 deletions(-) diff --git a/lib/chef/formatters/error_inspectors/compile_error_inspector.rb b/lib/chef/formatters/error_inspectors/compile_error_inspector.rb index e42340ff3a..d11f49e028 100644 --- a/lib/chef/formatters/error_inspectors/compile_error_inspector.rb +++ b/lib/chef/formatters/error_inspectors/compile_error_inspector.rb @@ -86,7 +86,7 @@ class Chef indicator = (i + 1) == culprit_line ? ">> " : ": " context_lines << "#{line_nr}#{indicator}#{file_lines[i]}" end - context_lines.join("") + context_lines.join end def display_lower_bound diff --git a/lib/chef/formatters/error_inspectors/resource_failure_inspector.rb b/lib/chef/formatters/error_inspectors/resource_failure_inspector.rb index 905a438f56..d4981b9066 100644 --- a/lib/chef/formatters/error_inspectors/resource_failure_inspector.rb +++ b/lib/chef/formatters/error_inspectors/resource_failure_inspector.rb @@ -91,7 +91,7 @@ class Chef current_line += 1 end relevant_lines << format_line(current_line + 1, lines[current_line + 1]) if lines[current_line + 1] - relevant_lines.join("") + relevant_lines.join end end end diff --git a/lib/chef/http/socketless_chef_zero_client.rb b/lib/chef/http/socketless_chef_zero_client.rb index 8c7ee8d8bc..33ae7f7c49 100644 --- a/lib/chef/http/socketless_chef_zero_client.rb +++ b/lib/chef/http/socketless_chef_zero_client.rb @@ -181,7 +181,7 @@ class Chef end def to_net_http(code, headers, chunked_body) - body = chunked_body.join("") + body = chunked_body.join msg = STATUS_MESSAGE[code] raise "Cannot determine HTTP status message for code #{code}" unless msg diff --git a/lib/chef/provider/mount/solaris.rb b/lib/chef/provider/mount/solaris.rb index 245e04f40e..1f9dcf15d1 100644 --- a/lib/chef/provider/mount/solaris.rb +++ b/lib/chef/provider/mount/solaris.rb @@ -214,7 +214,7 @@ class Chef def vfstab_write(contents) etc_tempfile do |f| - f.write(contents.join("")) + f.write(contents.join) f.close # move, preserving modes of destination file mover = Chef::FileContentManagement::Deploy.strategy(true) diff --git a/lib/chef/provider/service/redhat.rb b/lib/chef/provider/service/redhat.rb index 14b55bef85..63706027fd 100644 --- a/lib/chef/provider/service/redhat.rb +++ b/lib/chef/provider/service/redhat.rb @@ -106,13 +106,13 @@ class Chef # @api private def levels - (run_levels.nil? || run_levels.empty?) ? "" : "--level #{run_levels.join("")} " + (run_levels.nil? || run_levels.empty?) ? "" : "--level #{run_levels.join} " end def enable_service unless run_levels.nil? || run_levels.empty? disable_levels = current_run_levels - run_levels - shell_out! "/sbin/chkconfig --level #{disable_levels.join("")} #{new_resource.service_name} off" unless disable_levels.empty? + shell_out! "/sbin/chkconfig --level #{disable_levels.join} #{new_resource.service_name} off" unless disable_levels.empty? end shell_out! "/sbin/chkconfig #{levels}#{new_resource.service_name} on" end diff --git a/lib/chef/resource/swap_file.rb b/lib/chef/resource/swap_file.rb index 3d8f31de48..fefa210725 100644 --- a/lib/chef/resource/swap_file.rb +++ b/lib/chef/resource/swap_file.rb @@ -219,7 +219,7 @@ class Chef Chef::Log.info("#{new_resource} adding entry to #{fstab} for #{new_resource.path}") contents << "#{addition}\n" - ::File.open(fstab, "w") { |f| f.write(contents.join("")) } + ::File.open(fstab, "w") { |f| f.write(contents.join) } end end end -- cgit v1.2.1