Class: StandardTemplate

Inherits:
MetricFu::Template show all
Defined in:
lib/templates/standard/standard_template.rb

Instance Attribute Summary

Attributes inherited from MetricFu::Template

#per_file_data, #report

Instance Method Summary collapse

Instance Method Details

#this_directoryObject



23
24
25
# File 'lib/templates/standard/standard_template.rb', line 23

def this_directory
  File.dirname(__FILE__)
end

#writeObject



4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
# File 'lib/templates/standard/standard_template.rb', line 4

def write
  report.each_pair do |section, contents|
    mf_debug section
    if template_exists?(section)
      create_instance_var(section, contents)
      html = erbify(section)
      fn = output_filename(section)
      MetricFu.report.save_output(html, MetricFu.output_directory, fn)
    end
  end

  # Instance variables we need should already be created from above
  if template_exists?('index')
    html = erbify('index')
    fn = output_filename('index')
    MetricFu.report.save_output(html, MetricFu.output_directory, fn)
  end
end