lib/nanoc/extra/checking/checks/stale.rb in nanoc-3.6.7 vs lib/nanoc/extra/checking/checks/stale.rb in nanoc-3.6.8

- old
+ new

@@ -5,22 +5,22 @@ class Stale < ::Nanoc::Extra::Checking::Check def run require 'set' - item_rep_paths = Set.new(@site.items.collect { |i| i.reps }.flatten.collect { |r| r.raw_path }) + item_rep_paths = Set.new(@site.items.map { |i| i.reps }.flatten.map { |r| r.raw_path }) - self.output_filenames.each do |f| - next if self.pruner.filename_excluded?(f) + output_filenames.each do |f| + next if pruner.filename_excluded?(f) if !item_rep_paths.include?(f) - self.add_issue( - "file without matching item", + add_issue( + 'file without matching item', :subject => f) end end end - protected + protected def pruner exclude_config = @site.config.fetch(:prune, {}).fetch(:exclude, []) @pruner ||= Nanoc::Extra::Pruner.new(@site, :exclude => exclude_config) end