lita-totems 0.3.2 → 0.3.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/lita/handlers/totems.rb +3 -2
- data/lita-totems.gemspec +1 -1
- data/spec/lita/handlers/totems_spec.rb +3 -3
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b340aef8aaa657083579c632b1ec9e21f15e6a2f
|
4
|
+
data.tar.gz: a5e5246d1b28675f8920d47ad9fe7fffcb031f6f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e9c829d38054dc338cd885caa4f5adb6bf2b2bbeb7ec012b4e018d928bca4645ab3478878a50c11c0b952b35d90f5b5cf6e27341b5d73197f9ef1cab02df3605
|
7
|
+
data.tar.gz: cd735d4d982ed40e381e0e03a9ed0b15532b985e56941544283579f1629ff4adb32a53f8f9cafec69857ac3c8eb4a0f1096491b7ed8d4da07961d8746fd0c8eb
|
data/lib/lita/handlers/totems.rb
CHANGED
@@ -71,6 +71,7 @@ module Lita
|
|
71
71
|
owning_user_id = redis.get("totem/#{totem}/owning_user_id")
|
72
72
|
redis.srem("user/#{owning_user_id}/totems", totem) if owning_user_id
|
73
73
|
redis.del("totem/#{totem}/waiting_since")
|
74
|
+
redis.del("totem/#{totem}/message")
|
74
75
|
response.reply(%{Destroyed totem "#{totem}".})
|
75
76
|
else
|
76
77
|
response.reply(%{Error: totem "#{totem}" doesn't exist.})
|
@@ -182,7 +183,7 @@ module Lita
|
|
182
183
|
redis.srem("user/#{past_owning_user_id}/totems", totem)
|
183
184
|
redis.hdel("totem/#{totem}/waiting_since", past_owning_user_id)
|
184
185
|
redis.hdel("totem/#{totem}/message", past_owning_user_id)
|
185
|
-
robot.send_messages(Lita::Source.new(user: Lita::User.find_by_id(past_owning_user_id)), %{You have been kicked from totem "#{totem}".})
|
186
|
+
robot.send_messages(Lita::Source.new(user: Lita::User.find_by_id(past_owning_user_id)), %{You have been kicked from totem "#{totem}" by #{response.user.name}.})
|
186
187
|
next_user_id = redis.lpop("totem/#{totem}/list")
|
187
188
|
if next_user_id
|
188
189
|
redis.set("totem/#{totem}/owning_user_id", next_user_id)
|
@@ -249,7 +250,7 @@ module Lita
|
|
249
250
|
redis.sadd("user/#{next_user_id}/totems", totem)
|
250
251
|
redis.hset("totem/#{totem}/waiting_since", next_user_id, Time.now.to_i)
|
251
252
|
next_user = Lita::User.find_by_id(next_user_id)
|
252
|
-
robot.send_messages(Lita::Source.new(user: next_user), %{You are now in possession of totem "#{totem}.
|
253
|
+
robot.send_messages(Lita::Source.new(user: next_user), %{You are now in possession of totem "#{totem}," yielded by #{response.user.name}.})
|
253
254
|
response.reply "You have yielded the totem to #{next_user.name}."
|
254
255
|
else
|
255
256
|
redis.del("totem/#{totem}/owning_user_id")
|
data/lita-totems.gemspec
CHANGED
@@ -176,7 +176,7 @@ describe Lita::Handlers::Totems, lita_handler: true do
|
|
176
176
|
expect(robot).to receive(:send_messages).twice do |target, message|
|
177
177
|
expect([another_user.id, carl.id]).to include(target.user.id)
|
178
178
|
if target.user.id == another_user.id
|
179
|
-
expect(message).to eq(%{You are now in possession of totem "chicken.
|
179
|
+
expect(message).to eq(%{You are now in possession of totem "chicken," yielded by #{carl.name}.})
|
180
180
|
elsif target.user.id == carl.id
|
181
181
|
expect(message).to eq("You have yielded the totem to #{another_user.name}.")
|
182
182
|
end
|
@@ -362,7 +362,7 @@ describe Lita::Handlers::Totems, lita_handler: true do
|
|
362
362
|
if target.user.id == carl.id
|
363
363
|
expect(message).to eq(%{You are now in possession of totem "chicken".})
|
364
364
|
elsif target.user.id == another_user.id
|
365
|
-
expect(message).to eq(%{You have been kicked from totem "chicken".})
|
365
|
+
expect(message).to eq(%{You have been kicked from totem "chicken" by #{carl.name}.})
|
366
366
|
end
|
367
367
|
end
|
368
368
|
send_message("totems kick chicken", as: carl)
|
@@ -377,7 +377,7 @@ describe Lita::Handlers::Totems, lita_handler: true do
|
|
377
377
|
expect(robot).to receive(:send_messages).twice do |target, message|
|
378
378
|
expect([another_user.id, carl.id]).to include(target.user.id)
|
379
379
|
if target.user.id == carl.id
|
380
|
-
expect(message).to eq(%{You have been kicked from totem "chicken".})
|
380
|
+
expect(message).to eq(%{You have been kicked from totem "chicken" by #{user.name}.})
|
381
381
|
elsif target.user.id == another_user.id
|
382
382
|
expect(message).to eq("")
|
383
383
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: lita-totems
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Charles Finkel
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2016-02-09 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: lita
|