def outdatedness_reason
reason = lambda do
return :no_mtime if @item.mtime.nil?
return :forced if @force_outdated
return :no_raw_path if self.raw_path.nil?
return :not_written if !File.file?(self.raw_path)
compiled_mtime = File.stat(self.raw_path).mtime
return :source_modified if @item.mtime > compiled_mtime
return :layouts_outdated if @item.site.layouts.any? do |l|
l.mtime.nil? || l.mtime > compiled_mtime
end
return :code_outdated if @item.site.code_snippets.any? do |cs|
cs.mtime.nil? || cs.mtime > compiled_mtime
end
return :config_outdated if @item.site.config_mtime.nil?
return :config_outdated if @item.site.config_mtime > compiled_mtime
return :rules_outdated if @item.site.rules_mtime.nil?
return :rules_outdated if @item.site.rules_mtime > compiled_mtime
return nil
end[]
if reason.nil?
nil
else
{
:type => reason,
:description => OUTDATEDNESS_REASON_DESCRIPTIONS[reason]
}
end
end