lib/nanoc3/cli/commands/debug.rb in nanoc3-3.2.0a1 vs lib/nanoc3/cli/commands/debug.rb in nanoc3-3.2.0a2

- old
+ new

@@ -31,22 +31,22 @@ def run(options, arguments) # Make sure we are in a nanoc site directory print "Loading site data... " @base.require_site - @base.site.load_data puts "done" puts # Get data items = @base.site.items reps = items.map { |i| i.reps }.flatten layouts = @base.site.layouts # Get dependency tracker - dependency_tracker = @base.site.compiler.dependency_tracker - dependency_tracker.load_graph + compiler = @base.site.compiler + compiler.load + dependency_tracker = compiler.dependency_tracker # Print item dependencies puts '=== Item dependencies =======================================================' puts items.sort_by { |i| i.identifier }.each do |item| @@ -80,13 +80,13 @@ puts '=== Representation outdatedness =============================================' puts items.sort_by { |i| i.identifier }.each do |item| item.reps.sort_by { |r| r.name.to_s }.each do |rep| puts "item #{item.identifier}, rep #{rep.name}:" - outdatedness_reason = rep.outdatedness_reason + outdatedness_reason = compiler.outdatedness_reason_for(rep) if outdatedness_reason - puts " is outdated: #{outdatedness_reason[:type]} (#{outdatedness_reason[:description]})" + puts " is outdated: #{outdatedness_reason.message}" else puts " is not outdated" end end puts @@ -95,10 +95,15 @@ # Print layouts puts '=== Layouts' puts layouts.each do |layout| puts "layout #{layout.identifier}:" - puts " is #{layout.outdated? ? '' : 'not '}outdated" + outdatedness_reason = compiler.outdatedness_reason_for(layout) + if outdatedness_reason + puts " is outdated: #{outdatedness_reason.message}" + else + puts " is not outdated" + end puts end end end