lita-estimate 0.1.2 → 0.1.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +12 -2
- data/lib/lita/handlers/estimate.rb +10 -2
- data/lita-estimate.gemspec +1 -1
- data/spec/lita/handlers/estimate_spec.rb +18 -0
- 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: 26916839a60cffe50793e06c37f462932563df96
|
4
|
+
data.tar.gz: 4ff2792b3d469b34355a48018f205d6db0328db4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7f6c696e10214cb3d8f699ccacb8443a0a7e5be91e2d2fdc0649393d044e1e6c64f1e43b04050b1a7d2445aaa2af95516ae4b102db31865d88c1e2d87c6d9d3c
|
7
|
+
data.tar.gz: 6254becc8e51b85da9c3623d8e2ba4da58164a796b5c2076aa9f121e72bb920dfa526f204779b255a2c5f5b95e8dd35d0b3494ad7488d552b669b29800d065f3
|
data/README.md
CHANGED
@@ -16,12 +16,22 @@ gem "lita-estimate"
|
|
16
16
|
## Usage
|
17
17
|
|
18
18
|
```
|
19
|
+
1) In private chats with the bot:
|
20
|
+
|
19
21
|
Peter> @bot estimate US123 as 5
|
20
22
|
Bot> Thanks!
|
23
|
+
|
21
24
|
Paula> @bot estimate US123 as 3
|
22
25
|
Bot> Thanks!
|
23
|
-
|
26
|
+
|
27
|
+
2) In team room:
|
28
|
+
|
29
|
+
Carl> @bot US123 estimates
|
24
30
|
Bot> Peter: 5
|
25
31
|
Bot> Paula: 3
|
26
32
|
Bot> Average: 4
|
27
|
-
|
33
|
+
|
34
|
+
3) For more:
|
35
|
+
|
36
|
+
Carl> @bot help
|
37
|
+
```
|
@@ -2,8 +2,9 @@ module Lita
|
|
2
2
|
module Handlers
|
3
3
|
class Estimate < Handler
|
4
4
|
|
5
|
-
route /estimate ([A-Za-z0-9_.-]+) as (\d+)/, :estimate,
|
6
|
-
route /([A-Za-z0-9_.-]+) estimates/, :show_estimates,
|
5
|
+
route /estimate ([A-Za-z0-9_.-]+) as (\d+)/, :estimate, command: true, help: {"estimate STORY_ID as FIBONACCI_NUMBER" => "Records your estimate for the story"}
|
6
|
+
route /([A-Za-z0-9_.-]+) estimates/, :show_estimates, command: true, help: {"STORY_ID estimates" => "Lists all estimates for the story and their average"}
|
7
|
+
route /([A-Za-z0-9_.-]+) estimators/, :show_estimators, command: true, help: {"STORY_ID estimators" => "Lists all estimators for the story"}
|
7
8
|
|
8
9
|
def estimate(response)
|
9
10
|
story, points = response.matches.first
|
@@ -26,6 +27,13 @@ module Lita
|
|
26
27
|
response.reply("Average: #{average}")
|
27
28
|
end
|
28
29
|
|
30
|
+
def show_estimators(response)
|
31
|
+
story = response.matches.flatten.first
|
32
|
+
redis.hgetall(key(story)).each do |estimator, estimate|
|
33
|
+
response.reply(estimator)
|
34
|
+
end
|
35
|
+
end
|
36
|
+
|
29
37
|
def key(story)
|
30
38
|
['estimate', story].join(':')
|
31
39
|
end
|
data/lita-estimate.gemspec
CHANGED
@@ -7,6 +7,7 @@ describe Lita::Handlers::Estimate, lita_handler: true do
|
|
7
7
|
['US123', 'us123', 'SEARCH-01', 'SEARCH_02', 'SEARCH.2.1'].each do |story_format|
|
8
8
|
it { is_expected.to route_command("estimate #{story_format} as 1").to(:estimate) }
|
9
9
|
it { is_expected.to route_command("#{story_format} estimates").to(:show_estimates) }
|
10
|
+
it { is_expected.to route_command("#{story_format} estimators").to(:show_estimators) }
|
10
11
|
end
|
11
12
|
|
12
13
|
end
|
@@ -52,4 +53,21 @@ describe Lita::Handlers::Estimate, lita_handler: true do
|
|
52
53
|
|
53
54
|
end
|
54
55
|
|
56
|
+
describe "show estimators" do
|
57
|
+
|
58
|
+
before(:each) do
|
59
|
+
subject.redis.hset('estimate:US123', 'Peter', '5')
|
60
|
+
subject.redis.hset('estimate:US123', 'Paula', '3')
|
61
|
+
end
|
62
|
+
|
63
|
+
it "should list estimates" do
|
64
|
+
send_command('US123 estimators')
|
65
|
+
expect(replies.to_set).to eq(Set[
|
66
|
+
"Paula",
|
67
|
+
"Peter"
|
68
|
+
])
|
69
|
+
end
|
70
|
+
|
71
|
+
end
|
72
|
+
|
55
73
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: lita-estimate
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ingo Weiss
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-09-
|
11
|
+
date: 2015-09-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: lita
|