diff options
author | Seb Bacon <seb.bacon@gmail.com> | 2012-03-12 13:05:19 +0000 |
---|---|---|
committer | Seb Bacon <seb.bacon@gmail.com> | 2012-03-12 13:05:19 +0000 |
commit | 37bff4c0154b57b35a3194a9b31a9422496b955b (patch) | |
tree | 61592a6bb9d1d9fea378a6e4efa8fdf7d5525b8a /vendor/gems/rdoc-2.4.3/lib/rdoc/cache.rb | |
parent | 8b49dc894066e452232cabd09333895487f86986 (diff) | |
parent | 8acea24f98268fbb9b73b66b9e98a1788a3b30ac (diff) |
Merge branch 'merged-bundler' into develop
Diffstat (limited to 'vendor/gems/rdoc-2.4.3/lib/rdoc/cache.rb')
-rw-r--r-- | vendor/gems/rdoc-2.4.3/lib/rdoc/cache.rb | 41 |
1 files changed, 0 insertions, 41 deletions
diff --git a/vendor/gems/rdoc-2.4.3/lib/rdoc/cache.rb b/vendor/gems/rdoc-2.4.3/lib/rdoc/cache.rb deleted file mode 100644 index bdd830a13..000000000 --- a/vendor/gems/rdoc-2.4.3/lib/rdoc/cache.rb +++ /dev/null @@ -1,41 +0,0 @@ -require 'thread' -require 'singleton' - -## -# A generic, thread-safe in-memory cache. It's used for caching -# RDoc::TemplatePage objects when generating RDoc output. - -class RDoc::Cache - - include Singleton - - ## - # Creates a new, empty cache - - def initialize - @contents = {} - @lock = Mutex.new - end - - ## - # Checks whether there's a value in the cache with key +key+. If so, then - # that value will be returned. Otherwise, the given block will be run, and - # its return value will be put into the cache, and returned. - - def cache(key) - @lock.synchronize do - @contents[key] ||= yield - end - end - - ## - # Clears the contents of the cache - - def clear - @lock.synchronize do - @contents.clear - end - end - -end - |