lib/nanoc/cli/commands/show-rules.rb in nanoc-4.0.2 vs lib/nanoc/cli/commands/show-rules.rb in nanoc-4.1.0a1
- old
+ new
@@ -10,18 +10,19 @@
def run
require_site
@c = Nanoc::CLI::ANSIStringColorizer
@rules = site.compiler.rules_collection
+ @reps = site.compiler.reps
site.items.sort_by(&:identifier).each { |e| explain_item(e) }
site.layouts.sort_by(&:identifier).each { |e| explain_layout(e) }
end
def explain_item(item)
puts "#{@c.c('Item ' + item.identifier, :bold, :yellow)}:"
- item.reps.each do |rep|
+ @reps[item].each do |rep|
rule = @rules.compilation_rule_for(rep)
puts " Rep #{rep.name}: #{rule ? rule.pattern : '(none)'}"
end
puts