module Sprockets::PathDependencyUtils

Internal: Related PathUtils helpers that also track all the file system calls they make for caching purposes. All functions return a standard return value and a Set of cache dependency URIs that can be used in the future to see if the returned value should be invalidated from cache.

entries_with_dependencies("app/assets/javascripts")
# => [
#   ["application.js", "projects.js", "users.js", ...]
#    #<Set: {"file-digest:/path/to/app/assets/javascripts"}>
# ]

The returned dependency set can be passed to resolve_dependencies(deps) to check if the returned result is still fresh. In this case, entry always returns a single path, but multiple calls should accumulate dependencies into a single set thats saved off and checked later.

resolve_dependencies(deps)
# => "\x01\x02\x03"

Later, resolving the same set again will produce a different hash if something on the file system has changed.

resolve_dependencies(deps)
# => "\x03\x04\x05"