module Sprockets::PathUtils

def stat_tree(dir, &block)

Returns an Enumerator of [path, stat].

dir - A String directory

Public: Recursive stat all the files under a directory.
def stat_tree(dir, &block)
  return to_enum(__method__, dir) unless block_given?
  self.stat_directory(dir) do |path, stat|
    yield path, stat
    if stat.directory?
      stat_tree(path, &block)
    end
  end
  nil
end