summaryrefslogtreecommitdiff
path: root/lib/chef/mixin/which.rb
diff options
context:
space:
mode:
authorLamont Granquist <lamont@scriptkiddie.org>2019-07-31 09:57:05 -0700
committerLamont Granquist <lamont@scriptkiddie.org>2019-07-31 09:57:05 -0700
commit14b9553818265ecc35c037adfe479320e3a70e34 (patch)
treeec8f36c6f929f0c0b56f062484a280d6e645d61e /lib/chef/mixin/which.rb
parentf051b6e7912086edc03747f4b1c0285bfb6597f5 (diff)
downloadchef-lcg/weirich-semantic-block.tar.gz
For Discussion: Weirich Semantic Block stylelcg/weirich-semantic-block
Style/BlockDelimiters: Enabled: true EnforcedStyle: semantic See, eg: https://github.com/rubocop-hq/ruby-style-guide/issues/162 http://www.virtuouscode.com/2011/07/26/the-procedurefunction-block-convention-in-ruby/ Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
Diffstat (limited to 'lib/chef/mixin/which.rb')
-rw-r--r--lib/chef/mixin/which.rb8
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/chef/mixin/which.rb b/lib/chef/mixin/which.rb
index a51963b6c2..87946038ef 100644
--- a/lib/chef/mixin/which.rb
+++ b/lib/chef/mixin/which.rb
@@ -28,12 +28,12 @@ class Chef
# NOTE: unnecessarily duplicates function of path_sanity
extra_path ||= [ "/bin", "/usr/bin", "/sbin", "/usr/sbin" ]
paths = env_path.split(File::PATH_SEPARATOR) + Array(extra_path)
- cmds.map do |cmd|
- paths.map do |path|
+ cmds.map { |cmd|
+ paths.map { |path|
filename = Chef.path_to(File.join(path, cmd))
filename if valid_executable?(filename, &block)
- end.compact
- end.flatten
+ }.compact
+ }.flatten
end
private