diff options
author | Lamont Granquist <lamont@scriptkiddie.org> | 2019-07-05 13:26:53 -0700 |
---|---|---|
committer | Lamont Granquist <lamont@scriptkiddie.org> | 2019-07-05 13:26:53 -0700 |
commit | 3b10f9ca503dcbce747241281b9151d3d010f9ef (patch) | |
tree | 2e90f78a6910a4c673e19045a7f0627f1fc49382 /lib/chef/util | |
parent | 2a4916b7f01940d1199c35645c1b2172f5bd74b2 (diff) | |
download | chef-3b10f9ca503dcbce747241281b9151d3d010f9ef.tar.gz |
Style/SymbolProc
enforce pretzels.
Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
Diffstat (limited to 'lib/chef/util')
-rw-r--r-- | lib/chef/util/diff.rb | 4 | ||||
-rw-r--r-- | lib/chef/util/dsc/configuration_generator.rb | 4 | ||||
-rw-r--r-- | lib/chef/util/threaded_job_queue.rb | 2 |
3 files changed, 4 insertions, 6 deletions
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 |