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.
@@ -67,7 +67,7 @@ module ResqueBus
67
67
  def event_display_tuples
68
68
  out = []
69
69
  subscriptions.all.each do |sub|
70
- out << [sub.event_name, sub.queue_name]
70
+ out << [sub.class_name, sub.queue_name, sub.matcher.filters]
71
71
  end
72
72
  out
73
73
  end
@@ -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
- event, queue = tuple
26
- app_hash[app_key] << [event, queue]
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
- event_hash.each do |_, array|
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>&nbsp;</td><td>&nbsp;</td>"
51
61
  else
52
- detail, queue = val
53
- out = "<td>#{h(detail)}</td><td><a href='#{u("queues/#{queue}")}'>#{h(queue)}</a></td>"
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(" ", "&nbsp;").gsub('&quot;,&quot;', '&quot;, &quot;')}</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 event types and queues.</p>
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>&nbsp;</p>
91
-
104
+
92
105
  <h1 class='wi'>Events</h1>
93
- <p class='intro'>The event types below have been registered by the given applications and queues.</p>
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>&nbsp;</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>
@@ -1,5 +1,6 @@
1
1
  require 'resque-bus'
2
2
  require 'resque/server'
3
+ require 'erb'
3
4
 
4
5
  # Extend Resque::Server to add tabs.
5
6
  module ResqueBus
@@ -1,5 +1,5 @@
1
1
  module Resque
2
2
  module Bus
3
- VERSION = "0.2.3"
3
+ VERSION = "0.2.4"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: resque-bus
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.3
4
+ version: 0.2.4
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: