module Sprockets::PathUtils

def stat_directory(dir)

Returns an Enumerator of [path, stat].

dir - A String directory

Public: Stat all the files under a directory.
def stat_directory(dir)
  return to_enum(__method__, dir) unless block_given?
  self.entries(dir).each do |entry|
    path = File.join(dir, entry)
    if stat = self.stat(path)
      yield path, stat
    end
  end
  nil
end