Sha256: ab8f6e65fd01e6f702cee24db49ff5b7832b5cddd60369b3726f3e2c05d868dd
Contents?: true
Size: 525 Bytes
Versions: 14
Compression:
Stored size: 525 Bytes
Contents
module Heirloom module Utils module File def which(cmd) exts = pathext ? pathext.split(';') : [''] path.split(path_separator).each do |path| exts.each { |ext| exe = "#{path}/#{cmd}#{ext}" return exe if ::File.executable? exe } end return nil end def path_separator ::File::PATH_SEPARATOR end def path ENV['PATH'] end def pathext ENV['PATHEXT'] end end end end
Version data entries
14 entries across 14 versions & 1 rubygems