Module: MetricFu::TemplateHelpers
- Included in:
- Base::Generator
- Defined in:
- lib/metric_fu/base.rb
Overview
Template methods
Instance Method Summary collapse
- #cycle(first_value, second_value, iteration) ⇒ Object
- #inline_css(css) ⇒ Object
- #link_to_filename(name, line = nil) ⇒ Object
Instance Method Details
#cycle(first_value, second_value, iteration) ⇒ Object
119 120 121 122 |
# File 'lib/metric_fu/base.rb', line 119 def cycle(first_value, second_value, iteration) return first_value if iteration % 2 == 0 return second_value end |
#inline_css(css) ⇒ Object
107 108 109 |
# File 'lib/metric_fu/base.rb', line 107 def inline_css(css) open(File.join(MetricFu.configuration.template_dir, css)) { |f| f.read } end |
#link_to_filename(name, line = nil) ⇒ Object
111 112 113 114 115 116 117 |
# File 'lib/metric_fu/base.rb', line 111 def link_to_filename(name, line = nil) if MetricFu.run_by_cruise_control? cc_link_to_filename(name, line) else system_link_to_filename(name, line) end end |