resque-bus 0.2.3 → 0.2.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -14,6 +14,7 @@ else
|
|
14
14
|
|
15
15
|
<%
|
16
16
|
app_hash = {}
|
17
|
+
class_hash = {}
|
17
18
|
event_hash = {}
|
18
19
|
|
19
20
|
# collect each differently
|
@@ -22,16 +23,25 @@ else
|
|
22
23
|
|
23
24
|
app_hash[app_key] ||= []
|
24
25
|
app.event_display_tuples.each do |tuple|
|
25
|
-
|
26
|
-
|
26
|
+
class_name, queue, filters = tuple
|
27
|
+
if filters["bus_event_type"]
|
28
|
+
event = filters["bus_event_type"]
|
29
|
+
else
|
30
|
+
event = "see filter"
|
31
|
+
end
|
32
|
+
|
33
|
+
app_hash[app_key] << [event, class_name, queue, filters]
|
27
34
|
|
35
|
+
class_hash[class_name] ||= []
|
36
|
+
class_hash[class_name] << [app_key, event, queue, filters]
|
37
|
+
|
28
38
|
event_hash[event] ||= []
|
29
|
-
event_hash[event] << [app_key, queue]
|
39
|
+
event_hash[event] << [app_key, class_name, queue, filters]
|
30
40
|
end
|
31
41
|
end
|
32
42
|
|
33
43
|
# sort each list item by secondary label
|
34
|
-
|
44
|
+
class_hash.each do |_, array|
|
35
45
|
array.sort!{ |a,b| a.first <=> b.first }
|
36
46
|
end
|
37
47
|
event_hash.each do |_, array|
|
@@ -49,8 +59,9 @@ else
|
|
49
59
|
if !val
|
50
60
|
out = "<td> </td><td> </td>"
|
51
61
|
else
|
52
|
-
|
53
|
-
out = "<td>#{h(
|
62
|
+
one, two, queue, filters = val
|
63
|
+
out = "<td>#{h(one)}</td><td>#{h(two)}</td><td><a href='#{u("queues/#{queue}")}'>#{h(queue)}</a></td>"
|
64
|
+
out << "<td>#{h(Resque.encode(filters).gsub(/\"bus_special_value_(\w+)\"/){ "(#{$1})" }).gsub(" ", " ").gsub('","', '", "')}</td>"
|
54
65
|
end
|
55
66
|
|
56
67
|
if first
|
@@ -77,25 +88,46 @@ else
|
|
77
88
|
|
78
89
|
|
79
90
|
<h1 class='wi'>Applications</h1>
|
80
|
-
<p class='intro'>The apps below have registered the given
|
91
|
+
<p class='intro'>The apps below have registered the given classes and queues.</p>
|
81
92
|
<table class='queues'>
|
82
93
|
<tr>
|
83
94
|
<th>App Key</th>
|
84
95
|
<th>Event Type</th>
|
96
|
+
<th>Class Name</th>
|
85
97
|
<th>Queue</th>
|
98
|
+
<th>Filters</th>
|
86
99
|
</tr>
|
87
100
|
<%= output_hash(app_hash, ["Unsubscribe", "bus/unsubscribe"]) %>
|
88
101
|
</table>
|
89
102
|
|
90
103
|
<p> </p>
|
91
|
-
|
104
|
+
|
92
105
|
<h1 class='wi'>Events</h1>
|
93
|
-
<p class='intro'>The
|
106
|
+
<p class='intro'>The events below have been registered by the given applications and queues.</p>
|
94
107
|
<table class='queues'>
|
95
108
|
<tr>
|
96
109
|
<th>Event Type</th>
|
97
110
|
<th>App Key</th>
|
111
|
+
<th>Class Name</th>
|
98
112
|
<th>Queue</th>
|
113
|
+
<th>Filters</th>
|
99
114
|
</tr>
|
100
115
|
<%= output_hash(event_hash, false) %>
|
101
116
|
</table>
|
117
|
+
|
118
|
+
|
119
|
+
|
120
|
+
<p> </p>
|
121
|
+
|
122
|
+
<h1 class='wi'>Classes</h1>
|
123
|
+
<p class='intro'>The classes below have been registered by the given applications and queues.</p>
|
124
|
+
<table class='queues'>
|
125
|
+
<tr>
|
126
|
+
<th>Class Name</th>
|
127
|
+
<th>App Key</th>
|
128
|
+
<th>Event Type</th>
|
129
|
+
<th>Queue</th>
|
130
|
+
<th>Filters</th>
|
131
|
+
</tr>
|
132
|
+
<%= output_hash(class_hash, false) %>
|
133
|
+
</table>
|
data/lib/resque_bus/server.rb
CHANGED
data/lib/resque_bus/version.rb
CHANGED