Class: Diecut::TemplateListBuilder

Inherits:
ReportBuilder show all
Defined in:
lib/diecut/report-builders/template-list.rb

Instance Attribute Summary

Attributes inherited from ReportBuilder

#mill

Instance Method Summary collapse

Methods inherited from ReportBuilder

all_kinds, #build_report, #each_default, #each_option, #each_plugin, #each_template, #go, #initialize, #other_advice, #other_summary, #pass_advice, #pass_summary, register, #report, #review, #strict_sequence?, #unindent

Constructor Details

This class inherits a constructor from Diecut::ReportBuilder

Instance Method Details

#collectObject



15
16
17
18
19
# File 'lib/diecut/report-builders/template-list.rb', line 15

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

#fail_adviceObject



29
30
31
32
33
34
35
36
# File 'lib/diecut/report-builders/template-list.rb', line 29

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

#fail_summaryObject



25
26
27
# File 'lib/diecut/report-builders/template-list.rb', line 25

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

#report_fieldsObject



11
12
13
# File 'lib/diecut/report-builders/template-list.rb', line 11

def report_fields
  ["Template path"]
end

#report_nameObject



7
8
9
# File 'lib/diecut/report-builders/template-list.rb', line 7

def report_name
  "Templates included"
end

#report_statusObject



21
22
23
# File 'lib/diecut/report-builders/template-list.rb', line 21

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