Skip to content

Commit

Permalink
Document limitations of Tilt::Cache.
Browse files Browse the repository at this point in the history
  • Loading branch information
tommay committed Jul 11, 2015
1 parent cba2c37 commit 75ebbfc
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions lib/tilt.rb
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,16 @@ def self.current_template
# cache.fetch(path, line, options) { Tilt.new(path, line, options) }
#
# Subsequent invocations return the already loaded template object.
#
# @note
# Tilt::Cache is a thin wrapper around Hash. It has the following
# limitations:
# * Not thread-safe.
# * Size is unbounded.
# * Keys are not copied defensively, and should not be modified after
# being passed to #fetch. More specifically, the values returned by
# key#hash and key#eql? should not change.
# If this is too limiting for you, use a different cache implementation.
class Cache
def initialize
@cache = {}
Expand Down

0 comments on commit 75ebbfc

Please sign in to comment.