lib/nanoc/base/repos/store.rb in nanoc-4.9.4 vs lib/nanoc/base/repos/store.rb in nanoc-4.9.5
- old
+ new
@@ -38,13 +38,16 @@
@version = version
end
# Logic for building tmp path from active environment and store name
# @api private
- contract C::KeywordArgs[config: Nanoc::Int::Configuration, store_name: String] => String
+ contract C::KeywordArgs[config: Nanoc::Int::Configuration, store_name: String] => C::AbsolutePathString
def self.tmp_path_for(store_name:, config:)
- File.join(tmp_path_prefix(config.output_dir), store_name)
+ File.absolute_path(
+ File.join(tmp_path_prefix(config.output_dir), store_name),
+ config.dir,
+ )
end
def self.tmp_path_prefix(output_dir)
dir = Digest::SHA1.hexdigest(output_dir)[0..12]
File.join('tmp', 'nanoc', dir)
@@ -76,9 +79,10 @@
return unless File.file?(filename)
begin
pstore.transaction do
return if pstore[:version] != version
+
self.data = pstore[:data]
end
rescue
FileUtils.rm_f(filename)
load