From 3b10f9ca503dcbce747241281b9151d3d010f9ef Mon Sep 17 00:00:00 2001 From: Lamont Granquist Date: Fri, 5 Jul 2019 13:26:53 -0700 Subject: Style/SymbolProc enforce pretzels. Signed-off-by: Lamont Granquist --- lib/chef/util/diff.rb | 4 ++-- lib/chef/util/dsc/configuration_generator.rb | 4 +--- lib/chef/util/threaded_job_queue.rb | 2 +- 3 files changed, 4 insertions(+), 6 deletions(-) (limited to 'lib/chef/util') diff --git a/lib/chef/util/diff.rb b/lib/chef/util/diff.rb index 64cf41fab2..326f67a38e 100644 --- a/lib/chef/util/diff.rb +++ b/lib/chef/util/diff.rb @@ -90,8 +90,8 @@ class Chef diff_str = "" file_length_difference = 0 - old_data = IO.readlines(old_file).map { |e| e.chomp } - new_data = IO.readlines(new_file).map { |e| e.chomp } + old_data = IO.readlines(old_file).map(&:chomp) + new_data = IO.readlines(new_file).map(&:chomp) diff_data = ::Diff::LCS.diff(old_data, new_data) return diff_str if old_data.empty? && new_data.empty? diff --git a/lib/chef/util/dsc/configuration_generator.rb b/lib/chef/util/dsc/configuration_generator.rb index d2d358d61f..0c101b204d 100644 --- a/lib/chef/util/dsc/configuration_generator.rb +++ b/lib/chef/util/dsc/configuration_generator.rb @@ -132,9 +132,7 @@ class Chef::Util::DSC end def get_configuration_document(document_path) - ::File.open(document_path, "rb") do |file| - file.read - end + ::File.open(document_path, "rb", &:read) end end end diff --git a/lib/chef/util/threaded_job_queue.rb b/lib/chef/util/threaded_job_queue.rb index eaffd9ea70..6b13bf99a3 100644 --- a/lib/chef/util/threaded_job_queue.rb +++ b/lib/chef/util/threaded_job_queue.rb @@ -54,7 +54,7 @@ class Chef end end workers.each { |worker| self << Thread.method(:exit) } - workers.each { |worker| worker.join } + workers.each(&:join) end end end -- cgit v1.2.1