Skip to content

Instantly share code, notes, and snippets.

@chriseppstein
chriseppstein / dependency_extractor.rb
Created January 9, 2014 19:48
A ruby class for analyzing the dependencies in a sass file.
# extracts dependencies for a file
class DependencyExtractor
class Asset < Struct.new(:filename, :importer, :children)
def initialize(*args)
super
self.children ||= []
end
# transitive dependencies. Call `children` for just the immediate dependencies.
def dependencies