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

- old
+ new

@@ -41,12 +41,11 @@ items = @base.site.items reps = items.map { |i| i.reps }.flatten layouts = @base.site.layouts # Get dependency tracker - # FIXME clean this up - dependency_tracker = @base.site.compiler.send(:dependency_tracker) + dependency_tracker = @base.site.compiler.dependency_tracker dependency_tracker.load_graph # Print item dependencies puts '=== Item dependencies =======================================================' puts @@ -64,11 +63,17 @@ puts '=== Representation paths ====================================================' 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}:" - puts " #{rep.raw_path || '(not written)'}" + if rep.raw_paths.empty? + puts " (not written)" + end + length = rep.raw_paths.keys.map { |s| s.to_s.length }.max + rep.raw_paths.each do |snapshot_name, raw_path| + puts " [ %-#{length}s ] %s" % [ snapshot_name, raw_path ] + end end puts end # Print representation outdatedness @@ -89,10 +94,12 @@ # Print layouts puts '=== Layouts' puts layouts.each do |layout| - puts "layout #{layout.identifier}" + puts "layout #{layout.identifier}:" + puts " is #{layout.outdated? ? '' : 'not '}outdated" + puts end end end