Parent

Class/Module Index [+]

Quicksearch

Nanoc::ChecksumStore

Stores checksums for objects in order to be able to detect whether a file has changed since the last site compilation.

@api private

Public Class Methods

new(params={}) click to toggle source

@option params [Nanoc::Site] site The site where this checksum store

belongs to
# File lib/nanoc/base/compilation/checksum_store.rb, line 12
def initialize(params={})
  super('tmp/checksums', 1)

  @site = params[:site] if params.has_key?(:site)

  @checksums = {}
end

Public Instance Methods

[](obj) click to toggle source

Returns the old checksum for the given object. This makes sense for items, layouts and code snippets.

@param [reference] obj The object for which to fetch the checksum

@return [String] The checksum for the given object

# File lib/nanoc/base/compilation/checksum_store.rb, line 26
def [](obj)
  @checksums[obj.reference]
end
[]=(obj, checksum) click to toggle source

Sets the checksum for the given object.

@param [reference] obj The object for which to set the checksum

@param [String] checksum The checksum

# File lib/nanoc/base/compilation/checksum_store.rb, line 35
def []=(obj, checksum)
  @checksums[obj.reference] = checksum
end
unload() click to toggle source

@see Nanoc::Store#unload

# File lib/nanoc/base/compilation/checksum_store.rb, line 40
def unload
  @checksums = {}
end

Protected Instance Methods

data() click to toggle source
# File lib/nanoc/base/compilation/checksum_store.rb, line 46
def data
  @checksums
end
data=(new_data) click to toggle source
# File lib/nanoc/base/compilation/checksum_store.rb, line 50
def data=(new_data)
  @checksums = new_data
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.