in rake-runner-test/testData/bundler-discovery/bundler-1.11.2/lib/bundler.rb [285:296]
def which(executable)
if File.file?(executable) && File.executable?(executable)
executable
elsif ENV["PATH"]
path = ENV["PATH"].split(File::PATH_SEPARATOR).find do |p|
abs_path = File.join(p, executable)
File.file?(abs_path) && File.executable?(abs_path)
end
path && File.expand_path(executable, path)
end
end