lita-slack-standup 0.9.0 → 0.10.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +3 -3
- data/lib/lita/handlers/slack_standup.rb +27 -9
- data/lita-slack-standup.gemspec +1 -1
- data/locales/en.yml +8 -4
- data/locales/fr.yml +4 -0
- data/spec/lita/handlers/slack_standup_spec.rb +47 -1
- 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: b4da7d0c0f5efd3c66b7375cf0436b846c32cca8
|
4
|
+
data.tar.gz: d37286039c6068cf220331a1f9cffebe8352af9f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 184fa2d42176ae1b83201405ee45fcba74a116003117fff82a549577fffd8819acf89b303b232504a813dc205f6391b2c36c8ac3c3795c2e486729db4d98165e
|
7
|
+
data.tar.gz: b2bf9cd99cb33c11fdf18d0d93f4651d7a57ba1ef302a4cfc3ffa2011eaebea3a21ee6897003679593f3dcbc973232181980f48f2da4875a6281ec0268044447
|
data/README.md
CHANGED
@@ -23,10 +23,10 @@ end
|
|
23
23
|
## Usage
|
24
24
|
|
25
25
|
- !standup start : launches the standup, prints the standups already filled and asks for someone else to report
|
26
|
-
- !standup next :
|
27
|
-
- !standup report <some standup report> : saves your standup. If you do it before the start of the standup, you won't be asked to report. The bot will
|
26
|
+
- !standup next : consider current user's standup done and asks the next user to report
|
27
|
+
- !standup report <some standup report> : saves your standup. If you do it before the start of the standup, you won't be asked to report. The bot will display your standup in your stead
|
28
28
|
- !standup ignore <some user> : ignores an user for the standups
|
29
29
|
- !standup unignore <some user> : unignores an user
|
30
|
-
- !standup list :
|
30
|
+
- !standup list : lists all ignored users
|
31
31
|
|
32
32
|
The standup stops when everyone has done his report or has been skipped.
|
@@ -13,6 +13,8 @@ module Lita
|
|
13
13
|
route(/^standup\s+start$/, :standup_start, command: true, help: {t("help.start_cmd") => t("help.start_description") })
|
14
14
|
|
15
15
|
def standup_start(message=nil)
|
16
|
+
return if already_started?
|
17
|
+
|
16
18
|
in_standup.value = 'true'
|
17
19
|
send_message(config.channel, t("sentence.start"))
|
18
20
|
prewritten_standups_summary
|
@@ -81,12 +83,37 @@ module Lita
|
|
81
83
|
)
|
82
84
|
end
|
83
85
|
|
86
|
+
route(/^standup\s+end$/, :standup_end, command: true, help: {t("help.end_cmd") => t("help.end_description")})
|
87
|
+
|
88
|
+
def standup_end(message=nil)
|
89
|
+
contextual_end_message
|
90
|
+
|
91
|
+
in_standup.value = 'false'
|
92
|
+
update_standup_members
|
93
|
+
update_ids_to_members
|
94
|
+
end
|
95
|
+
|
84
96
|
private
|
85
97
|
|
86
98
|
def extract_user(message)
|
87
99
|
message.matches[0][0].gsub('@','')
|
88
100
|
end
|
89
101
|
|
102
|
+
def already_started?
|
103
|
+
if in_standup.value == 'true'
|
104
|
+
send_message(config.channel, t("sentence.already_started"))
|
105
|
+
end
|
106
|
+
in_standup.value == 'true'
|
107
|
+
end
|
108
|
+
|
109
|
+
def contextual_end_message
|
110
|
+
if in_standup.value == 'true'
|
111
|
+
send_message(config.channel,t("sentence.end_standup"))
|
112
|
+
else
|
113
|
+
send_message(config.channel, t("sentence.clear_objects"))
|
114
|
+
end
|
115
|
+
end
|
116
|
+
|
90
117
|
def standup_check?
|
91
118
|
if in_standup.value != 'true'
|
92
119
|
send_message(config.channel, t("sentence.next_forbidden"))
|
@@ -170,15 +197,6 @@ module Lita
|
|
170
197
|
def select_next_standup
|
171
198
|
standup_members.select{ |key,value| value.empty? }.first.first
|
172
199
|
end
|
173
|
-
|
174
|
-
def standup_end
|
175
|
-
in_standup.value = 'false'
|
176
|
-
|
177
|
-
send_message(config.channel,t("sentence.end_standup"))
|
178
|
-
|
179
|
-
update_standup_members
|
180
|
-
update_ids_to_members
|
181
|
-
end
|
182
200
|
end
|
183
201
|
Lita.register_handler(SlackStandup)
|
184
202
|
end
|
data/lita-slack-standup.gemspec
CHANGED
data/locales/en.yml
CHANGED
@@ -4,17 +4,19 @@ en:
|
|
4
4
|
slack_standup:
|
5
5
|
help:
|
6
6
|
start_cmd: standup start
|
7
|
-
start_description: Launches the standup, prints the
|
7
|
+
start_description: Launches the standup, prints the reports already filled and asks for someone else to report
|
8
8
|
report_cmd: standup report TEXTE
|
9
|
-
report_description: Saves your standup. If you do it before the start of the standup, you won't be asked to report. The bot will
|
9
|
+
report_description: Saves your standup. If you do it before the start of the standup, you won't be asked to report. The bot will display your standup in your stead
|
10
10
|
next_cmd: standup next
|
11
|
-
next_description:
|
11
|
+
next_description: Consider current's user standup done and asks the next user to report
|
12
12
|
ignore_cmd: standup ignore USER
|
13
13
|
ignore_description: Ignores an user for the standups
|
14
14
|
unignore_cmd: standup unignore USER
|
15
15
|
unignore_description: Unignores an user
|
16
16
|
list_cmd: standup list
|
17
17
|
list_description: List all ignored users
|
18
|
+
end_cmd: standup end
|
19
|
+
end_description: End the standup, clear the saved standups and update the users list.
|
18
20
|
sentence:
|
19
21
|
start: "Hello <!channel> ! The standup is starting :)"
|
20
22
|
report: "your standup is saved. Thanks :)"
|
@@ -24,6 +26,8 @@ en:
|
|
24
26
|
unignore: "<@%{user}> is now an attendee of the standups"
|
25
27
|
list: "Ignored users : "
|
26
28
|
next_forbidden: "The command is unavailable outside standups."
|
27
|
-
standup_done: "%{user} has already filled his standup: \n %{standup}"
|
29
|
+
standup_done: "%{user} has already filled her/his/its standup: \n %{standup}"
|
28
30
|
standup_fill: "Standup done in live."
|
31
|
+
already_started: "The standup is already started."
|
29
32
|
end_standup: "That's it ! It's all good for today. Thanks everyone :)"
|
33
|
+
clear_objects: "We're not during standup. The saved standups have been erased and the users list updated."
|
data/locales/fr.yml
CHANGED
@@ -15,6 +15,8 @@ fr:
|
|
15
15
|
unignore_description: Remet l'utilisateur dans la liste des personnes participant aux standups
|
16
16
|
list_cmd: standup list
|
17
17
|
list_description: Liste les utilisateurs ignorés
|
18
|
+
end_cmd: standup end
|
19
|
+
end_description: Termine le standup, efface les standups enregistrés et met `a jour la liste des utilisateurs.
|
18
20
|
sentence:
|
19
21
|
start: "Hello <!channel> ! Le standup va commencer :)"
|
20
22
|
report: "Ton standup est enregistré. Merci :)"
|
@@ -26,4 +28,6 @@ fr:
|
|
26
28
|
next_forbidden: "La commande n'est pas disponible en dehors d'un standup."
|
27
29
|
standup_done: "%{user} a déjà renseigné son standup : \n %{standup}"
|
28
30
|
standup_fill: "Standup fait en live."
|
31
|
+
already_started: "Le standup est déjà en cours."
|
29
32
|
end_standup: "Et voilà ! C'est bon pour aujourd'hui. Merci tout le monde :)"
|
33
|
+
clear_objects: "Aucun standup en cours. Les standups enregistrés ont été supprimés et la liste des utilisateurs mise à jour."
|
@@ -21,7 +21,7 @@ describe Lita::Handlers::SlackStandup, lita_handler: true do
|
|
21
21
|
|
22
22
|
stub_request(:post, "https://slack.com/api/channels.list").
|
23
23
|
with(:headers => header).
|
24
|
-
to_return(:status => 200, :body => '{"ok":true,"channels":[{"id":"
|
24
|
+
to_return(:status => 200, :body => '{"ok":true,"channels":[{"id":"C","name":"jambot-test","members":["B","A","C","D","E"],"num_members":5}]}', :headers => {})
|
25
25
|
|
26
26
|
stub_request(:post, "https://slack.com/api/chat.postMessage").
|
27
27
|
with(:body => {"as_user"=>"true", "channel"=>"#jambot-test", "text"=>"Hello <!channel> ! Le standup va commencer :)", "token"=>nil},:headers => header).
|
@@ -38,11 +38,20 @@ describe Lita::Handlers::SlackStandup, lita_handler: true do
|
|
38
38
|
stub_request(:post, "https://slack.com/api/chat.postMessage").
|
39
39
|
with(:body => {"as_user"=>"true", "channel"=>"#jambot-test", "text"=>"Et voilà ! C'est bon pour aujourd'hui. Merci tout le monde :)", "token"=>nil},:headers => header).
|
40
40
|
to_return(:status => 200, :body => '{"ok": true,"channel": "C","message": "Et voilà ! C\'est bon pour aujourd\'hui. Merci tout le monde :)"}', :headers => {})
|
41
|
+
|
42
|
+
stub_request(:post, "https://slack.com/api/chat.postMessage").
|
43
|
+
with(:body => {"as_user"=>"true", "channel"=>"#jambot-test", "text"=>"Aucun standup en cours. Les standups enregistrés ont été supprimés et la liste des utilisateurs mise à jour.", "token"=>nil},:headers => header).
|
44
|
+
to_return(:status => 200, :body => '{"ok": true,"channel": "C","message": "Aucun standup en cours. Les standups enregistrés ont été supprimés et la liste des utilisateurs mise à jour."}', :headers => {})
|
41
45
|
|
42
46
|
stub_request(:post, "https://slack.com/api/chat.postMessage").
|
43
47
|
with(:body => {"as_user"=>"true", "channel"=>"#jambot-test", "text"=>"La commande n'est pas disponible en dehors d'un standup.", "token"=>nil},:headers => header).
|
44
48
|
to_return(:status => 200, :body => '{"ok": true,"channel": "C","message": "La commande n\'est pas disponible en dehors d\'un standup."}', :headers => {})
|
49
|
+
|
50
|
+
stub_request(:post, "https://slack.com/api/chat.postMessage").
|
51
|
+
with(:body => {"as_user"=>"true", "channel"=>"#jambot-test", "text"=>"Le standup est déjà en cours.", "token"=>nil},:headers => header).
|
52
|
+
to_return(:status => 200, :body => '{"ok": true,"channel": "C","message": "Le standup est déjà en cours."}', :headers => {})
|
45
53
|
|
54
|
+
|
46
55
|
reg.register_handler(Lita::Handlers::SlackStandup)
|
47
56
|
|
48
57
|
reg.configure do |config|
|
@@ -80,6 +89,16 @@ describe Lita::Handlers::SlackStandup, lita_handler: true do
|
|
80
89
|
subject
|
81
90
|
end
|
82
91
|
|
92
|
+
context "during standup" do
|
93
|
+
before do
|
94
|
+
send_message("!standup start", as: sybil, from: channel)
|
95
|
+
end
|
96
|
+
|
97
|
+
it "doesn't restart the standup" do
|
98
|
+
expect_any_instance_of(Slack::Web::Client).to receive(:chat_postMessage).with({:channel=>channel, :text=>"Le standup est déjà en cours.", :as_user=>true})
|
99
|
+
subject
|
100
|
+
end
|
101
|
+
end
|
83
102
|
context "with pre-filled report" do
|
84
103
|
before do
|
85
104
|
send_message("!standup report My standup report for testing purposes", as: sybil, from: channel)
|
@@ -192,4 +211,31 @@ describe Lita::Handlers::SlackStandup, lita_handler: true do
|
|
192
211
|
expect(replies.last).to eq("<@sybil> est à nouveau inclus dans les standups.")
|
193
212
|
end
|
194
213
|
end
|
214
|
+
|
215
|
+
describe "!standup end" do
|
216
|
+
subject do
|
217
|
+
send_message("!standup end", as: sybil, from: channel)
|
218
|
+
end
|
219
|
+
|
220
|
+
it { is_expected.to route("!standup end") }
|
221
|
+
|
222
|
+
context "during standup" do
|
223
|
+
before do
|
224
|
+
send_message("!standup start", as: sybil, from: channel)
|
225
|
+
end
|
226
|
+
|
227
|
+
it "ends the standup" do
|
228
|
+
expect_any_instance_of(Slack::Web::Client).to receive(:chat_postMessage).with({:channel=>channel, :text=>"Et voilà ! C'est bon pour aujourd'hui. Merci tout le monde :)", :as_user=>true})
|
229
|
+
subject
|
230
|
+
end
|
231
|
+
end
|
232
|
+
|
233
|
+
context "outside the standup" do
|
234
|
+
it "clears the objects" do
|
235
|
+
|
236
|
+
expect_any_instance_of(Slack::Web::Client).to receive(:chat_postMessage).with({:channel=>channel, :text=>"Aucun standup en cours. Les standups enregistrés ont été supprimés et la liste des utilisateurs mise à jour.", :as_user=>true})
|
237
|
+
subject
|
238
|
+
end
|
239
|
+
end
|
240
|
+
end
|
195
241
|
end
|