Sha256: b2da0be888ed50646e04b05878ebc71f80910bc11aed2e0cbdf4cc29ca5926ea
Contents?: true
Size: 861 Bytes
Versions: 10
Compression:
Stored size: 861 Bytes
Contents
# frozen_string_literal: true module Nanoc::Checking::Checks # @api private class Stale < ::Nanoc::Checking::Check identifier :stale def run 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 def item_rep_paths @item_rep_paths ||= Set.new( @items .flat_map(&:reps) .map(&:unwrap) .flat_map(&:raw_paths) .flat_map(&:values) .flatten, ) end def pruner exclude_config = @config.fetch(:prune, {}).fetch(:exclude, []) # FIXME: reps=nil is icky @pruner ||= Nanoc::Pruner.new(@config, nil, exclude: exclude_config) end end end
Version data entries
10 entries across 10 versions & 1 rubygems