lib/nanoc3/base/item_rep.rb in nanoc3-3.1.0rc1 vs lib/nanoc3/base/item_rep.rb in nanoc3-3.1.0
- old
+ new
@@ -394,12 +394,10 @@
#
# @return [String, nil] The difference between the old and new compiled
# content in `diff(1)` format, or nil if there is no previous compiled
# content
def diff
- return nil if !@item.site.config[:enable_output_diff]
-
if self.binary?
nil
else
@diff_thread.join if @diff_thread
@diff
@@ -437,10 +435,10 @@
# Done
[ filter, filter_name, filter_args ]
end
def generate_diff
- if @old_content.nil? or self.raw_path.nil?
+ if @old_content.nil? || self.raw_path.nil? || !@item.site.config[:enable_output_diff]
@diff = nil
else
@diff_thread = Thread.new do
@diff = diff_strings(@old_content, @content[:last])
sleep 2