Speed up compilation a bit.

This commit is contained in:
Chris Eppstein 2010-01-30 15:50:25 -08:00
parent e71e267eab
commit 4fa7fdd14b

View File

@ -128,11 +128,20 @@ def mixin_signature(mixin)
mixin.sass_signature(:include) mixin.sass_signature(:include)
end end
def mixin_examples(item, mixin) def example_items
@items.select do |i| @example_items ||= @items.select{|i| i[:example]}
i[:example] && end
def examples_for_item(item)
@examples ||= {}
@examples[item] ||= example_items.select do |i|
i[:framework] == item[:framework] && i[:framework] == item[:framework] &&
i[:stylesheet] == item[:stylesheet] && i[:stylesheet] == item[:stylesheet]
end
end
def mixin_examples(item, mixin)
examples_for_item(item).select do |i|
i[:mixin] == mixin.name i[:mixin] == mixin.name
end.map{|i| i.reps.find{|r| r.name == :default}} end.map{|i| i.reps.find{|r| r.name == :default}}
end end