Let File.expand_path also do the join

This commit is contained in:
Jack Nagel 2014-07-06 13:36:58 -05:00
parent 7bd4f76b8c
commit 6e60b1d8c3

View File

@ -184,7 +184,7 @@ end
def which cmd, path=ENV['PATH']
path.split(File::PATH_SEPARATOR).each do |p|
pcmd = File.expand_path(File.join(p, cmd))
pcmd = File.expand_path(cmd, p)
return Pathname.new(pcmd) if File.file?(pcmd) && File.executable?(pcmd)
end
return nil