def search_dirs
      @logger.operation(:searching) do
        until @stack.empty?
          dir = @stack.last
          entry = dir.read
          if entry == nil
            dir.close
            @stack.pop
            next
          end

          next if entry == '.' || entry == '..'
          next if ignorable?(entry)

          fullpath = File.join(dir.path, entry)

          if File.directory?(fullpath)
            result = find_next(Dir.new(fullpath))
            break
          end
        end
        result
      end
    end
def search_dirs
      @logger.operation(:searching) do
        until @stack.empty?
          dir = @stack.last
          entry = dir.read
          if entry == nil
            dir.close
            @stack.pop
            next
          end

          next if entry == '.' || entry == '..'
          next if ignorable?(entry)

          fullpath = File.join(dir.path, entry)

          if File.directory?(fullpath)
            result = find_next(Dir.new(fullpath))
            break
          end
        end
        result
      end
    end
Search the directory stack looking for the next resource.