lita-totems 0.3.0 → 0.3.1
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.
- checksums.yaml +4 -4
- data/lib/lita/handlers/totems.rb +6 -4
- data/lita-totems.gemspec +1 -1
- data/spec/lita/handlers/totems_spec.rb +4 -4
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 04bc52d9b4cb545151bf9169b928be5c0ac001aa
|
4
|
+
data.tar.gz: 8acfd0dbacf8df24fbc72ed1861e6489acec0ef8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e00c7649a4842f437a9f0a5e5b1988ad33025349330ec42e6c885f8ee6c1d6cb4e85e5a08f5c42db207671528eeabf84c1c2e210b4477c4fc34abf6f796ff9c4
|
7
|
+
data.tar.gz: 985ef09a1be5e6c815d6fc194ad21fff0057ab5e79e4bef40dedc260c5ccf7ecbc71d302e5a514fdb702a94a53e35a7402a576e32c228568c427f2dfc9df766f
|
data/lib/lita/handlers/totems.rb
CHANGED
@@ -221,12 +221,14 @@ module Lita
|
|
221
221
|
if first_id
|
222
222
|
waiting_since_hash = redis.hgetall("totem/#{totem}/waiting_since")
|
223
223
|
message_hash = redis.hgetall("totem/#{totem}/message")
|
224
|
-
str
|
225
|
-
str += "
|
224
|
+
str += "#{prefix}1. #{users_cache[first_id].name} (held for #{waiting_duration(waiting_since_hash[first_id])})"
|
225
|
+
str += " - #{message_hash[first_id]}" if message_hash[first_id]
|
226
|
+
str += "\n"
|
226
227
|
rest = redis.lrange("totem/#{totem}/list", 0, -1)
|
227
228
|
rest.each_with_index do |user_id, index|
|
228
|
-
str += "#{prefix}#{index+2}. #{users_cache[user_id].name} (waiting for #{waiting_duration(waiting_since_hash[user_id])})
|
229
|
-
str += "
|
229
|
+
str += "#{prefix}#{index+2}. #{users_cache[user_id].name} (waiting for #{waiting_duration(waiting_since_hash[user_id])})"
|
230
|
+
str += " - #{message_hash[user_id]}" if message_hash[user_id]
|
231
|
+
str += "\n"
|
230
232
|
end
|
231
233
|
end
|
232
234
|
str
|
data/lita-totems.gemspec
CHANGED
@@ -127,17 +127,17 @@ describe Lita::Handlers::Totems, lita_handler: true do
|
|
127
127
|
before do
|
128
128
|
Timecop.freeze("2014-03-01 12:00:00") do
|
129
129
|
send_message("totems add chicken message", as: carl)
|
130
|
-
send_message("totems add chicken
|
130
|
+
send_message("totems add chicken", as: another_user)
|
131
|
+
send_message("totems add chicken other message", as: yet_another_user)
|
131
132
|
end
|
132
133
|
end
|
133
134
|
it "includes the message in the totems' info" do
|
134
135
|
Timecop.freeze("2014-03-01 13:00:00") do
|
135
136
|
send_message("totems info chicken")
|
136
137
|
expect(replies.last).to eq <<-END
|
137
|
-
1. Carl (held for 1h)
|
138
|
-
message
|
138
|
+
1. Carl (held for 1h) - message
|
139
139
|
2. person_1 (waiting for 1h)
|
140
|
-
|
140
|
+
3. person_2 (waiting for 1h) - other message
|
141
141
|
END
|
142
142
|
end
|
143
143
|
end
|