Just use each since we're returning from inside the block

This commit is contained in:
Jack Nagel 2014-07-06 11:16:10 -05:00
parent c7ac8ce454
commit 7e268670ed

View File

@ -183,7 +183,7 @@ def puts_columns items, star_items=[]
end
def which cmd, path=ENV['PATH']
path.split(File::PATH_SEPARATOR).find do |p|
path.split(File::PATH_SEPARATOR).each do |p|
pcmd = File.expand_path(File.join(p, cmd))
return Pathname.new(pcmd) if File.executable?(pcmd) && !File.directory?(pcmd)
end