class Sprockets::DirectiveProcessor

def process_require_tree_directive(path = ".")


//= require_tree "./public"

Its glob equivalent is `path/**/*`.
`require_tree` requires all the nested files in a directory.
def process_require_tree_directive(path = ".")
  if relative?(path)
    root = pathname.dirname.join(path).expand_path
    unless (stats = stat(root)) && stats.directory?
      raise ArgumentError, "require_tree argument must be a directory"
    end
    context.depend_on(root)
    each_entry(root) do |pathname|
      if pathname.to_s == self.file
        next
      elsif stat(pathname).directory?
        context.depend_on(pathname)
      elsif context.asset_requirable?(pathname)
        context.require_asset(pathname)
      end
    end
  else
    # The path must be relative and start with a `./`.
    raise ArgumentError, "require_tree argument must be a relative path"
  end
end