Sha256: d5c70d21ddc2d78c2b49266c78bacfdd0dbef64c63b98599b8cbff542ddf9733

Contents?: true

Size: 609 Bytes

Versions: 1

Compression:

Stored size: 609 Bytes

Contents

module MaintenanceLightHelper
  
  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 = <<-HTML
    <span class="maintenance-light" rel="tooltip" title="#{maintenance_light.message}">
      <i class="stoplight #{maintenance_light.color}"></i>
      #{maintenance_light.dependency_name if options.fetch(:with_name, false)}
      #{maintenance_light.version}
    </span>
    HTML
    html.html_safe
  rescue Rubygems::Error
    "?".html_safe
  end
  
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
houston-core-0.5.0.beta1 app/helpers/maintenance_light_helper.rb