lib/nanoc/base/repos/store.rb in nanoc-4.0.2 vs lib/nanoc/base/repos/store.rb in nanoc-4.1.0a1
- old
+ new
@@ -55,42 +55,30 @@
# Loads the data from the filesystem into memory. This method will set the
# loaded data using the {#data=} method.
#
# @return [void]
def load
- # Don’t load twice
- if @loaded
- return
- end
-
# Check file existance
unless File.file?(filename)
no_data_found
- @loaded = true
return
end
begin
pstore.transaction do
# Check version
if pstore[:version] != version
version_mismatch_detected
- @loaded = true
return
end
# Load
self.data = pstore[:data]
- @loaded = true
end
rescue
FileUtils.rm_f(filename)
load
end
- end
-
- # Undoes the effects of {#load}. Used when {#load} raises an exception.
- def unload
end
# Stores the data contained in memory to the filesystem. This method will
# use the {#data} method to fetch the data that should be written.
#