lita-resistance 0.2.0 → 0.2.1

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: 56058720df7598135c26c691f0f98b7c37600d17
4
- data.tar.gz: 9087749376c680d7ac497d00a22d43c16beb3b55
3
+ metadata.gz: e01368713992622db461d4cf9e9f401754e2fa40
4
+ data.tar.gz: 93708f06b073f98346f90318a4c4c93c5a097d69
5
5
  SHA512:
6
- metadata.gz: 3261aa80c4928c9ecc9f4bab37d3e47d3937553db26c100840a9a27a0f08be0b3d97ecb660804ba6ec90f96400a2e1f128ed167bdca0f9d11242a793dfa3b73b
7
- data.tar.gz: c38e41459be472a673336cd9d4882a87c79555f537cbe7896a255c774aa7524e80e515b76cf692ddc3e5c7752cb2a6e94752848e16da8d95d16bb3254b621a27
6
+ metadata.gz: bc04e890e9a9aa6674f28baf91e80e26c284a7089e96cbda06f3fe36af7b96ea14687f2bda593b9a4f29808667b63555355666e640d1f8c8f7d9fdfc7f32681b
7
+ data.tar.gz: bd50d1ed8d33ab0f6c1c9ddb106dbb2d818051b426bb0ad29264761a7d542c0bc0d8531fbc0e47ed87c04e40f117c426c8c93587cecb033e1641277910292a18
data/README.md CHANGED
@@ -1,18 +1,32 @@
1
- # lita-resistance
2
-
3
- [![Build Status](https://travis-ci.org/DeonHua/lita-resistance.png?branch=master)](https://travis-ci.org/DeonHua/lita-resistance)
4
- [![Coverage Status](https://coveralls.io/repos/DeonHua/lita-resistance/badge.png)](https://coveralls.io/r/DeonHua/lita-resistance)
5
-
6
- Plays a game of resistance by assigning roles to users you mention in chat.
7
-
8
- ## Installation
9
-
10
- Add lita-resistance to your Lita instance's Gemfile:
11
-
12
- ``` ruby
13
- gem "lita-resistance"
14
- ```
15
-
16
- ## Usage
17
-
18
- `lita resistance [users]` - Assigns the roles of spy/resistance to users you mention.
1
+ # lita-resistance
2
+
3
+ [![Build Status](https://travis-ci.org/DeonHua/lita-resistance.png?branch=master)](https://travis-ci.org/DeonHua/lita-resistance)
4
+ [![Coverage Status](https://coveralls.io/repos/DeonHua/lita-resistance/badge.png)](https://coveralls.io/r/DeonHua/lita-resistance)
5
+
6
+ Plays a game of resistance by assigning roles to users you mention in chat.
7
+
8
+ ## Installation
9
+
10
+ Add lita-resistance to your Lita instance's Gemfile:
11
+
12
+ ``` ruby
13
+ gem "lita-resistance"
14
+ ```
15
+
16
+ ## Usage
17
+
18
+ `lita resistance [users]` - Assigns the roles of spy/resistance to users you mention.
19
+
20
+ ### Examples
21
+
22
+ `lita resistance @player1 @player2 @player3 @player4 @player5`
23
+
24
+ You don't need to include the `@` symbol:
25
+
26
+ `lita resistance player1 player2 player3 player4 player5`
27
+
28
+ You can also do a combination of both:
29
+
30
+ `lita resistance @player1 @player2 player3 player4 player5`
31
+
32
+ [![forthebadge](http://forthebadge.com/images/badges/built-with-love.svg)](http://forthebadge.com)
@@ -45,7 +45,15 @@ module Lita
45
45
 
46
46
  spies.each do |member|
47
47
  user = Lita::User.find_by_mention_name(member)
48
- robot.send_message(Source.new(user: user),"@#{response.user.mention_name} has started game ID ##{gameId} of Resistance. You are a member of the spies.")
48
+ current_user = Source.new(user: user)
49
+ robot.send_message(current_user,"@#{response.user.mention_name} has started game ID ##{gameId} of Resistance. You are a member of the spies.")
50
+ other_spies = spies.dup
51
+ other_spies.delete_at(other_spies.find_index(member))
52
+ if other_spies.length > 1
53
+ robot.send_message(current_user, "The other spies are: @#{other_spies.join(' @')}")
54
+ else
55
+ robot.send_message(current_user, "The other spy is: @#{other_spies[0]}")
56
+ end
49
57
  end
50
58
 
51
59
  resistance.each do |member|
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |spec|
2
2
  spec.name = "lita-resistance"
3
- spec.version = "0.2.0"
3
+ spec.version = "0.2.1"
4
4
  spec.authors = ["Deon Hua", "Yu Chen Hou"]
5
5
  spec.email = ["deonhbci@gmail.com", "me@yuchen.io"]
6
6
  spec.description = "Plays a game of resistance by assigning roles to users you mention in chat."
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: lita-resistance
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Deon Hua