<% app_hash = {} event_hash = {} # collect each differently ResqueBus::Application.all.each do |app| app_key = app.app_key app_hash[app_key] ||= [] app.event_display_tuples.each do |tuple| event, queue = tuple app_hash[app_key] << [event, queue] event_hash[event] ||= [] event_hash[event] << [app_key, queue] end end # sort each list item by secondary label event_hash.each do |_, array| array.sort!{ |a,b| a.first <=> b.first } end event_hash.each do |_, array| array.sort!{ |a,b| a.first <=> b.first } end # helper to display either def display_row(name, val, button=nil, first=false) form = "" if button text, url = button form = "
" end if !val out = "  " else detail, queue = val out = "#{h(detail)}#{h(queue)}" end if first "#{h(name)}#{form}#{out}\n" else " #{out}\n" end end def output_hash(hash, action=nil) out = "" hash.keys.sort.each do |item| display = hash[item] first = display.shift out << display_row(item, first, action, true) display.each do |val| out << display_row(item, val, action) end end out end %>

Applications

The apps below have registered the given event types and queues.

<%= output_hash(app_hash, ["Unsubscribe", "bus/unsubscribe"]) %>
App Key Event Type Queue

 

Events

The event types below have been registered by the given applications and queues.

<%= output_hash(event_hash, false) %>
Event Type App Key Queue