def find_executables
      return enum_for(:find_executables) unless block_given?

      exts = (ENV.has_key?('PATHEXT') ? ENV.fetch('PATHEXT').split(';') : []) << ''
      paths = @path.sub('*', ENV['PATH']).split(File::PATH_SEPARATOR)
      raise ArgumentError.new('No PATH to search!') if paths.empty?
      cmds = strict? ? @executables.first(1) : @executables

      lookup_cache = Set.new
      cmds.product(paths, exts).map do |cmd, path, ext|
        exe = File.absolute_path?(cmd) ? cmd : File.expand_path("#{cmd}#{ext}", path)

        next unless lookup_cache.add?(exe) # don't yield the same exe path 2x
        next unless File.executable?(exe)
        next if File.directory?(exe)

        yield exe
      end
    end
def find_executables
      return enum_for(:find_executables) unless block_given?

      exts = (ENV.has_key?('PATHEXT') ? ENV.fetch('PATHEXT').split(';') : []) << ''
      paths = @path.sub('*', ENV['PATH']).split(File::PATH_SEPARATOR)
      raise ArgumentError.new('No PATH to search!') if paths.empty?
      cmds = strict? ? @executables.first(1) : @executables

      lookup_cache = Set.new
      cmds.product(paths, exts).map do |cmd, path, ext|
        exe = File.absolute_path?(cmd) ? cmd : File.expand_path("#{cmd}#{ext}", path)

        next unless lookup_cache.add?(exe) # don't yield the same exe path 2x
        next unless File.executable?(exe)
        next if File.directory?(exe)

        yield exe
      end
    end
Analog of Windows `where` command, or a `which` that finds *all*
 matching executables on the supplied path.
 @return [Enumerable<String>] - the executables found, lazily.