lita-standup 0.0.2 → 0.1.0
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/README.md +1 -1
- data/lib/lita/email_job.rb +1 -5
- data/lib/lita/handlers/standup.rb +9 -9
- data/lita-standup.gemspec +1 -1
- data/spec/lita/handlers/standup_spec.rb +12 -11
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 36be7d907470851d05ce4ba716a4806e1b8c6ed4
|
4
|
+
data.tar.gz: 876282f4aa028beeac92c1e26a0c0d62bd628788
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0a45a0287a1eb32a4843c169fb3611389c95a27471d8c74ba9457080660758f7a66b401e713929caa7db3d858205c19feedb3c22ae3fc0b7d94915c2116dbf46
|
7
|
+
data.tar.gz: c2847eed2237c66fbe78657bd29b9b772d98aa984f8052558c1818460f8a5a958d9210f451df56744fb1247841e4d22b8ed20f7ede1b06cfb6acb453669e60a6
|
data/README.md
CHANGED
@@ -4,7 +4,7 @@
|
|
4
4
|
[](https://coveralls.io/r/chriswoodrich/lita-standup)
|
5
5
|
[](http://badge.fury.io/rb/lita-standup)
|
6
6
|
|
7
|
-
Lita-standup is a handler for Lita, meant to automate the process of the daily standup, and help teams collaborate.
|
7
|
+
Lita-standup is a handler for [Lita](https://github.com/jimmycuadra/lita), meant to automate the process of the daily standup, and help teams collaborate.
|
8
8
|
|
9
9
|
## Installation
|
10
10
|
|
data/lib/lita/email_job.rb
CHANGED
@@ -4,11 +4,7 @@ require 'sucker_punch'
|
|
4
4
|
class SummaryEmailJob
|
5
5
|
include SuckerPunch::Job
|
6
6
|
|
7
|
-
def
|
8
|
-
sec == 0 ? preform(payload) : after(sec) { preform(payload) } #0 seconds not handled well by #after
|
9
|
-
end
|
10
|
-
|
11
|
-
def preform(payload)
|
7
|
+
def perform(payload)
|
12
8
|
redis = payload[:redis]
|
13
9
|
config = payload[:config]
|
14
10
|
|
@@ -24,11 +24,10 @@ module Lita
|
|
24
24
|
redis.set('last_standup_started_at', Time.now)
|
25
25
|
find_and_create_users
|
26
26
|
message_all_users
|
27
|
-
SummaryEmailJob.
|
27
|
+
SummaryEmailJob.perform_in(config.time_to_respond * 60, {redis: redis, config: config})
|
28
28
|
end
|
29
29
|
|
30
30
|
def process_standup(request)
|
31
|
-
|
32
31
|
return unless timing_is_right?
|
33
32
|
request.reply('Response recorded. Thanks for partipating')
|
34
33
|
date_string = Time.now.strftime('%Y%m%d')
|
@@ -40,17 +39,18 @@ module Lita
|
|
40
39
|
|
41
40
|
def message_all_users
|
42
41
|
@users.each do |user|
|
43
|
-
|
44
|
-
robot.send_message(
|
45
|
-
|
46
|
-
|
47
|
-
|
42
|
+
source = Lita::Source.new(user: user)
|
43
|
+
robot.send_message(source, "Time for standup!")
|
44
|
+
robot.send_message(source, "Please tell me (in the following format)
|
45
|
+
Lita standup response
|
46
|
+
1. things you worked on yesterday,
|
47
|
+
2. things you'll be doing today,
|
48
|
+
3. anything that's blocking you.")
|
48
49
|
end
|
49
50
|
end
|
50
51
|
|
51
52
|
def find_and_create_users
|
52
|
-
@users
|
53
|
-
Lita.logger.debug(@users.inspect)
|
53
|
+
@users ||= robot.auth.groups_with_users[config.name_of_auth_group]
|
54
54
|
end
|
55
55
|
|
56
56
|
def timing_is_right?
|
data/lita-standup.gemspec
CHANGED
@@ -5,12 +5,12 @@ describe Lita::Handlers::Standup, lita_handler: true do
|
|
5
5
|
it { is_expected.to route_command("start standup now").with_authorization_for(:standup_admins).to(:begin_standup) }
|
6
6
|
it { is_expected.to route_command("standup response 1:a2:b3:c").to(:process_standup) }
|
7
7
|
|
8
|
-
jimmy = Lita::User.create(111, name: "Jimmy")
|
9
|
-
tristan = Lita::User.create(112, name: "Tristan")
|
10
|
-
mitch = Lita::User.create(113, name: "Mitch")
|
11
|
-
people = [jimmy, tristan, mitch]
|
12
8
|
|
13
9
|
before do
|
10
|
+
@jimmy = Lita::User.create(111, name: "Jimmy")
|
11
|
+
@tristan = Lita::User.create(112, name: "Tristan")
|
12
|
+
@mitch = Lita::User.create(113, name: "Mitch")
|
13
|
+
people = [@jimmy, @tristan, @mitch]
|
14
14
|
registry.config.handlers.standup.time_to_respond = 0 #Not async for testing
|
15
15
|
registry.config.handlers.standup.address = 'smtp.gmail.com'
|
16
16
|
registry.config.handlers.standup.port = 587
|
@@ -25,15 +25,16 @@ describe Lita::Handlers::Standup, lita_handler: true do
|
|
25
25
|
|
26
26
|
describe '#begin_standup' do
|
27
27
|
it 'messages each user and prompts for stand up options' do
|
28
|
-
send_command("start standup now", as: jimmy)
|
28
|
+
send_command("start standup now", as: @jimmy)
|
29
29
|
expect(replies.size).to eq(6) #Jimmy, Tristan, and Mitch
|
30
|
+
|
30
31
|
end
|
31
32
|
|
32
33
|
it 'properly queues an email job upon initiation' do
|
33
34
|
registry.config.handlers.standup.email_subject_line = "This is a test of Lita-Standup"
|
34
35
|
registry.config.handlers.standup.time_to_respond = 60
|
35
|
-
send_command("start standup now", as: jimmy)
|
36
|
-
send_command("standup response 1: everything 2:everything else 3:nothing", as: jimmy)
|
36
|
+
send_command("start standup now", as: @jimmy)
|
37
|
+
send_command("standup response 1: everything 2:everything else 3:nothing", as: @jimmy)
|
37
38
|
expect(Celluloid::Actor.registered.first.to_s).to end_with("summary_email_job")
|
38
39
|
end
|
39
40
|
end
|
@@ -41,10 +42,10 @@ describe Lita::Handlers::Standup, lita_handler: true do
|
|
41
42
|
describe '#process_standup' do
|
42
43
|
it 'Emails a compendium of responses out after users reply' do
|
43
44
|
registry.config.handlers.standup.time_to_respond = (1.0/60.0)
|
44
|
-
send_command("start standup now", as: jimmy)
|
45
|
-
send_command("standup response 1: linguistics 2: more homework 3: being in seattle", as: tristan)
|
46
|
-
send_command("standup response 1: stitchfix 2: more stitchfix 3: gaining weight", as: mitch)
|
47
|
-
send_command("standup response 1: lita 2: Rust else 3: nothing", as: jimmy)
|
45
|
+
send_command("start standup now", as: @jimmy)
|
46
|
+
send_command("standup response 1: linguistics 2: more homework 3: being in seattle", as: @tristan)
|
47
|
+
send_command("standup response 1: stitchfix 2: more stitchfix 3: gaining weight", as: @mitch)
|
48
|
+
send_command("standup response 1: lita 2: Rust else 3: nothing", as: @jimmy)
|
48
49
|
sleep(2);
|
49
50
|
expect(Mail::TestMailer.deliveries.last.body.raw_source).to include "Tristan\n1: linguistics \n2: more homework \n3: being in seattle\n"
|
50
51
|
expect(Mail::TestMailer.deliveries.last.body.raw_source).to include "Jimmy\n1: lita \n2: Rust else \n3: nothing\n"
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: lita-standup
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0
|
4
|
+
version: 0.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Chris Woodrich
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2018-10-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: lita
|
@@ -191,7 +191,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
191
191
|
version: '0'
|
192
192
|
requirements: []
|
193
193
|
rubyforge_project:
|
194
|
-
rubygems_version: 2.
|
194
|
+
rubygems_version: 2.6.13
|
195
195
|
signing_key:
|
196
196
|
specification_version: 4
|
197
197
|
summary: Daily standup automation for easier collaboration
|