Class: Nanoc::Extra::Checking::Checks::Stale
- Inherits:
-
Nanoc::Extra::Checking::Check
- Object
- Nanoc::Extra::Checking::Check
- Nanoc::Extra::Checking::Checks::Stale
- Defined in:
- lib/nanoc/extra/checking/checks/stale.rb
Instance Attribute Summary
Attributes inherited from Nanoc::Extra::Checking::Check
Instance Method Summary (collapse)
Methods inherited from Nanoc::Extra::Checking::Check
#add_issue, #initialize, #output_filenames
Methods included from PluginRegistry::PluginMethods
#all, #identifier, #identifiers, #named, #register
Constructor Details
This class inherits a constructor from Nanoc::Extra::Checking::Check
Instance Method Details
- (Object) run
7 8 9 10 11 12 13 14 15 16 17 18 19 20 |
# File 'lib/nanoc/extra/checking/checks/stale.rb', line 7 def run require 'set' item_rep_paths = Set.new(@site.items.collect { |i| i.reps }.flatten.collect { |r| r.raw_path }) self.output_filenames.each do |f| next if self.pruner.filename_excluded?(f) if !item_rep_paths.include?(f) self.add_issue( "file without matching item", :subject => f) end end end |