Class: MetricFu::Templates::MetricsTemplate
- Inherits:
-
MetricFu::Template
- Object
- MetricFu::Template
- MetricFu::Templates::MetricsTemplate
- Defined in:
- lib/metric_fu/templates/metrics_template.rb
Instance Attribute Summary collapse
-
#formatter ⇒ Object
Returns the value of attribute formatter.
-
#html ⇒ Object
Returns the value of attribute html.
-
#metrics ⇒ Object
Returns the value of attribute metrics.
-
#name ⇒ Object
Returns the value of attribute name.
-
#per_file_data ⇒ Object
Returns the value of attribute per_file_data.
-
#result ⇒ Object
Returns the value of attribute result.
Attributes inherited from MetricFu::Template
Instance Method Summary collapse
Methods inherited from MetricFu::Template
Instance Attribute Details
#formatter ⇒ Object
Returns the value of attribute formatter.
10 11 12 |
# File 'lib/metric_fu/templates/metrics_template.rb', line 10 def formatter @formatter end |
#html ⇒ Object
Returns the value of attribute html.
10 11 12 |
# File 'lib/metric_fu/templates/metrics_template.rb', line 10 def html @html end |
#metrics ⇒ Object
Returns the value of attribute metrics.
10 11 12 |
# File 'lib/metric_fu/templates/metrics_template.rb', line 10 def metrics @metrics end |
#name ⇒ Object
Returns the value of attribute name.
10 11 12 |
# File 'lib/metric_fu/templates/metrics_template.rb', line 10 def name @name end |
#per_file_data ⇒ Object
Returns the value of attribute per_file_data.
10 11 12 |
# File 'lib/metric_fu/templates/metrics_template.rb', line 10 def per_file_data @per_file_data end |
#result ⇒ Object
Returns the value of attribute result.
10 11 12 |
# File 'lib/metric_fu/templates/metrics_template.rb', line 10 def result @result end |
Instance Method Details
#html_filename(file) ⇒ Object
26 27 28 29 |
# File 'lib/metric_fu/templates/metrics_template.rb', line 26 def html_filename(file) file = Digest::SHA1.hexdigest(file)[0..29] "#{file.gsub(%r{/}, '_')}.html" end |
#write ⇒ Object
12 13 14 15 16 17 18 19 20 21 22 23 24 |
# File 'lib/metric_fu/templates/metrics_template.rb', line 12 def write self.name = MetricFu.report_name self.metrics = {} copy_javascripts result.each_pair do |section, contents| write_section(section, contents) end write_index write_file_data end |