class Sprockets::Base

def circular_call_protection(path)

def circular_call_protection(path)
  reset = Thread.current[:sprockets_circular_calls].nil?
  calls = Thread.current[:sprockets_circular_calls] ||= Set.new
  if calls.include?(path)
    raise CircularDependencyError, "#{path} has already been required"
  end
  calls << path
  yield
ensure
  Thread.current[:sprockets_circular_calls] = nil if reset
end