Sha256: c8b835d5b03b7bda237d972a5ae533b787a3bbf4313f7ffc030368c3f6a5c80c

Contents?: true

Size: 625 Bytes

Versions: 11

Compression:

Stored size: 625 Bytes

Contents

# encoding: utf-8

module Nanoc::Extra::Checking

  class Check

    extend Nanoc::PluginRegistry::PluginMethods

    attr_reader :site
    attr_reader :issues

    def initialize(site)
      @site   = site
      @issues = Set.new
    end

    def run
      raise NotImplementedError.new("Nanoc::Extra::Checking::Check subclasses must implement #run")
    end

    def add_issue(desc, params={})
      subject  = params.fetch(:subject, nil)

      @issues << Issue.new(desc, subject, self.class)
    end

    def output_filenames
      Dir[@site.config[:output_dir] + '/**/*'].select{ |f| File.file?(f) }
    end

  end

end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
nanoc-3.6.7 lib/nanoc/extra/checking/check.rb
nanoc-3.6.6 lib/nanoc/extra/checking/check.rb
nanoc-3.6.5 lib/nanoc/extra/checking/check.rb
nanoc-3.6.4 lib/nanoc/extra/checking/check.rb
nanoc-3.6.3 lib/nanoc/extra/checking/check.rb
nanoc-3.6.2 lib/nanoc/extra/checking/check.rb
nanoc-3.6.1 lib/nanoc/extra/checking/check.rb
nanoc-3.6.0 lib/nanoc/extra/checking/check.rb
nanoc-3.5.0 lib/nanoc/extra/checking/check.rb
nanoc-3.5.0b2 lib/nanoc/extra/checking/check.rb
nanoc-3.5.0b1 lib/nanoc/extra/checking/check.rb