Sha256: 2c4634b7ff2e39f0c061bcf66b827bf62ecfa901ca9ccde6f2d3cba12a41a076

Contents?: true

Size: 779 Bytes

Versions: 3

Compression:

Stored size: 779 Bytes

Contents

require 'diecut/report-builder'

module Diecut
  class TemplateListBuilder < ReportBuilder
    register

    def report_name
      "Templates included"
    end

    def report_fields
      ["Template path"]
    end

    def collect
      each_template do |name, template|
        report.add(template.path)
      end
    end

    def report_status
      report.empty? ? 'FAIL' : 'OK'
    end

    def fail_summary
      report.summary = "No templates will render"
    end

    def fail_advice
      (<<-EOA)
      No plugin provides any templates. This is probably simple misconfiguration a plugin, or an important plugin has been omitted.

      Plugins: #{mill.mediator.activated_plugins.map(&:name)}
      Plugin template paths: #{mill.valise.to_s}
      EOA
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
diecut-0.0.5 lib/diecut/report-builders/template-list.rb
diecut-0.0.4 lib/diecut/report-builders/template-list.rb
diecut-0.0.3 lib/diecut/report-builders/template-list.rb