lib/nanoc/cli/commands/show-rules.rb in nanoc-4.8.3 vs lib/nanoc/cli/commands/show-rules.rb in nanoc-4.8.4
- old
+ new
@@ -8,28 +8,28 @@
"
module Nanoc::CLI::Commands
class ShowRules < ::Nanoc::CLI::CommandRunner
def run
- load_site
+ @site = load_site
@c = Nanoc::CLI::ANSIStringColorizer
- compiler = site.compiler
+ compiler = @site.compiler
compiler.build_reps
@reps = compiler.reps
- action_provider = site.compiler.action_provider
+ action_provider = @site.compiler.action_provider
unless action_provider.respond_to?(:rules_collection)
raise(
::Nanoc::Int::Errors::GenericTrivial,
'The show-rules command can only be used for sites with the Rule DSL action provider.',
)
end
@rules = action_provider.rules_collection
- site.items.sort_by(&:identifier).each { |e| explain_item(e) }
- site.layouts.sort_by(&:identifier).each { |e| explain_layout(e) }
+ @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)}:"