Sha256: 13808c68c143899492c7ccf8f12c0c68558f60815a411eb064da1347aba1ffb9
Contents?: true
Size: 672 Bytes
Versions: 29
Compression:
Stored size: 672 Bytes
Contents
class Puppeteer::ExecutablePathFinder # @param executable_names [Array<String>] executable file names to find. def initialize(*executable_names) @executable_names = executable_names end def find_executables_in_path Enumerator.new do |result| @executable_names.each do |name| # Find the first existing path. paths.each do |path| candidate = File.join(path, name) next unless File.exist?(candidate) result << candidate break end end end end def find_first find_executables_in_path.first end private def paths ENV['PATH'].split(File::PATH_SEPARATOR) end end
Version data entries
29 entries across 29 versions & 1 rubygems