compass/doc-src/lib/data_sources/nanoc_monkey_patches.rb

13 lines
168 B
Ruby
Raw Normal View History

2010-02-07 17:14:20 +00:00
class Nanoc3::Site
def cached(key)
if cache.has_key?(key)
cache[key]
else
cache[key]= yield
end
end
def cache
@cache ||= {}
end
end