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

13 lines
203 B
Ruby
Raw Normal View History

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