class Rake::Funnel::Support::Which

Public Class Methods

which(executable) click to toggle source
# File lib/rake/funnel/support/which.rb, line 8
def which(executable)
  return executable if File.file?(executable)

  ENV['PATH']
    .split(File::PATH_SEPARATOR)
    .map { |path| File.join(path, executable) }
    .select { |path| File.file?(path) }
    .first
end