class Nanoc::Extra::Checking::Checks::Stale

@api private

Public Instance Methods

run() click to toggle source
# File lib/nanoc/extra/checking/checks/stale.rb, line 4
def run
  require 'set'

  output_filenames.each do |f|
    next if pruner.filename_excluded?(f)
    next if item_rep_paths.include?(f)

    add_issue(
      'file without matching item',
      subject: f)
  end
end

Protected Instance Methods

item_rep_paths() click to toggle source
# File lib/nanoc/extra/checking/checks/stale.rb, line 19
def item_rep_paths
  @item_rep_paths ||=
    Set.new(
      @items
        .flat_map(&:reps)
        .map(&:unwrap)
        .flat_map(&:raw_paths)
        .flat_map(&:values))
end
pruner() click to toggle source
# File lib/nanoc/extra/checking/checks/stale.rb, line 29
def pruner
  exclude_config = @config.fetch(:prune, {}).fetch(:exclude, [])
  @pruner ||= Nanoc::Extra::Pruner.new(@site, exclude: exclude_config)
end