Module: MaintenanceLightHelper

Defined in:
app/helpers/maintenance_light_helper.rb

Instance Method Summary collapse

Instance Method Details

#format_maintenance_light(arg, options = {}) ⇒ Object



3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
# File 'app/helpers/maintenance_light_helper.rb', line 3

def format_maintenance_light(arg, options={})
  maintenance_light = arg.respond_to?(:maintenance_light) ? arg.maintenance_light : arg
  return "—".html_safe if maintenance_light.nil?

  html = "  <span class=\"maintenance-light\" rel=\"tooltip\" title=\"\#{maintenance_light.message}\">\n    <i class=\"stoplight \#{maintenance_light.color}\"></i>\n    \#{maintenance_light.dependency_name if options.fetch(:with_name, false)}\n    \#{maintenance_light.version}\n  </span>\n  HTML\n  html.html_safe\nrescue Rubygems::Error\n  \"?\".html_safe\nend\n"