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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 00ae39366e972651c7ae806eb7a597007cd01154
4
- data.tar.gz: c2dd28f6555177f0a0bb889b6593a62fbd351b94
3
+ metadata.gz: b340aef8aaa657083579c632b1ec9e21f15e6a2f
4
+ data.tar.gz: a5e5246d1b28675f8920d47ad9fe7fffcb031f6f
5
5
  SHA512:
6
- metadata.gz: 39442874ca40f413b9fdd5a4ba9882448d7d1993019ddb2a07ef61f4a562a7929e5043c5309558417e2256880ce83e27d2c7a1bf9c655b9c082279eb9123ae37
7
- data.tar.gz: f3e6cd22f2d3b396ed12d199c043f462247257d6eee6606a647acca55c27821e1c8f131312b80732c038a24551a97af98752d3f9ba62cb3667b83f276ecac2cd
6
+ metadata.gz: e9c829d38054dc338cd885caa4f5adb6bf2b2bbeb7ec012b4e018d928bca4645ab3478878a50c11c0b952b35d90f5b5cf6e27341b5d73197f9ef1cab02df3605
7
+ data.tar.gz: cd735d4d982ed40e381e0e03a9ed0b15532b985e56941544283579f1629ff4adb32a53f8f9cafec69857ac3c8eb4a0f1096491b7ed8d4da07961d8746fd0c8eb
@@ -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")
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |spec|
2
2
  spec.name = "lita-totems"
3
- spec.version = "0.3.2"
3
+ spec.version = "0.3.3"
4
4
  spec.authors = ["Charles Finkel", "Vijay Ramesh"]
5
5
  spec.email = ["cf@dropbox.com", "vijay@change.org"]
6
6
  spec.description = %q{Totems handler for Lita)}
@@ -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.2
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: 2015-09-17 00:00:00.000000000 Z
12
+ date: 2016-02-09 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: lita