You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: tools.rb
    path of file: ./repos/nanoc/nanoc/lib/nanoc/data_sources/filesystem
    
    the code of the file until where you have to start completion: # frozen_string_literal: true

class Nanoc::DataSources::Filesystem < Nanoc::DataSource
  # Contains useful functions for managing the filesystem.
  #
  # @api private
  module Tools
    # Error that is raised wh
    
    def all_files_in(dir_name, extra_files, recursion_limit = 10)
      all_files_and_dirs_in(dir_name, extra_files).map do |fn|
        case File.ftype(fn)
        when 'link'
          if recursion_limit.zero?
            raise MaxSymlinkDepthExceededError.new(fn)
          else
            absolute_target = resolve_symlink(fn)
            if File.file?(absolute_target)
              fn
            else
              all_files_in(absolute_target, extra_files, recursion_limit - 1).map do |sfn|
                fn + sfn[absolute_target.size..]
              end
            end
          end