lib/nanoc/base/repos/checksum_store.rb in nanoc-4.0.2 vs lib/nanoc/base/repos/checksum_store.rb in nanoc-4.1.0a1
- old
+ new
@@ -2,16 +2,15 @@
# Stores checksums for objects in order to be able to detect whether a file
# has changed since the last site compilation.
#
# @api private
class ChecksumStore < ::Nanoc::Int::Store
- # @option params [Nanoc::Int::Site] site The site where this checksum store
- # belongs to
- def initialize(params = {})
+ # @param [Nanoc::Int::Site] site
+ def initialize(site: nil)
super('tmp/checksums', 1)
- @site = params[:site] if params.key?(:site)
+ @site = site
@checksums = {}
end
# Returns the old checksum for the given object. This makes sense for
@@ -29,14 +28,9 @@
# @param [#reference] obj The object for which to set the checksum
#
# @param [String] checksum The checksum
def []=(obj, checksum)
@checksums[obj.reference] = checksum
- end
-
- # @see Nanoc::Int::Store#unload
- def unload
- @checksums = {}
end
protected
def data