lita-estimate 0.1.5 → 0.1.6

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: ad344b1cdb4aa633161c6a85c6a23f4bb43bb6db
4
- data.tar.gz: f3d41d7944d1a0cc24fc588f8305d4b1b52cff89
3
+ metadata.gz: a0f0f5308e0f0bdb4e495f4190e284bfd8cb5592
4
+ data.tar.gz: d9b7c27c51c53077db924fe30cc5bde8d678b31a
5
5
  SHA512:
6
- metadata.gz: 0faf63327375d93f7feb54af5f3960e7495c76f3d1d4418c1d6109cad5abd9dfab916579c4d110ce250062b26eb4d1e4fee76fbcc23769c6d3413dca87d11028
7
- data.tar.gz: b99c5d4444ec437e42730c7bccea4ca009fa6e22cde754ce2074c403ba319aecf51a01685a0e4d81210ce7f85710ce1165b00001e9928e9037ef3626e90eacae
6
+ metadata.gz: a63e13092b246f694f1adfd0e47ed3865d0e607cd4d706006695eddc7b1b53f9e2faeec07e0848f36f6861c67bd0dc7efc22a0007a938dba8f38ad50752fa80c
7
+ data.tar.gz: 2f85cbe80deb35ecb3adf20b9b5fc8587181e3a851958f07c5df945bea778fd77e0b2ed91736ee6b88715a07fafa7b7865e0995565ad96742ee5ca4b4bd2c80e
data/.gitignore CHANGED
@@ -15,3 +15,4 @@ spec/reports
15
15
  test/tmp
16
16
  test/version_tmp
17
17
  tmp
18
+ .DS_Store
data/README.md CHANGED
@@ -1,7 +1,9 @@
1
1
  # lita-estimate
2
2
 
3
+ [![Gem Version](https://badge.fury.io/rb/lita-estimate.svg)](https://badge.fury.io/rb/lita-estimate)
3
4
  [![Build Status](https://travis-ci.org/ingoweiss/lita-estimate.png?branch=master)](https://travis-ci.org/ingoweiss/lita-estimate)
4
5
  [![Coverage Status](https://coveralls.io/repos/ingoweiss/lita-estimate/badge.png)](https://coveralls.io/r/ingoweiss/lita-estimate)
6
+ [![Code Climate](https://codeclimate.com/github/ingoweiss/lita-estimate/badges/gpa.svg)](https://codeclimate.com/github/ingoweiss/lita-estimate)
5
7
 
6
8
  Just a silly little Lita plugin for estimation
7
9
 
@@ -27,9 +29,9 @@ Bot> Thanks!
27
29
  2) In team room:
28
30
 
29
31
  Carl> @bot US123 estimates
30
- Bot> Peter: 5
31
- Bot> Paula: 3
32
- Bot> Average: 4
32
+ Bot> 5 (Peter)
33
+ Bot> 3 (Paula)
34
+ Bot> 4.0 (Average)
33
35
 
34
36
  3) For more:
35
37
 
@@ -24,11 +24,10 @@ module Lita
24
24
  response.reply("No estimates yet for #{story}")
25
25
  else
26
26
  lines = []
27
- estimates.keys.sort.each do |estimator|
28
- lines << "#{estimator}: #{estimates[estimator]}"
27
+ estimates.map{|dev, est| [est.to_i, dev]}.sort.each do |estimate, estimator|
28
+ lines << "#{estimate} (#{estimator})"
29
29
  end
30
- average = estimates.values.inject(0){ |sum, e| sum + e.to_i }.to_f / estimates.size
31
- lines << "Average: #{average}"
30
+ lines << "#{average(estimates.values)} Average"
32
31
  response.reply(lines.join("\n"))
33
32
  end
34
33
  end
@@ -53,6 +52,10 @@ module Lita
53
52
  ['estimate', story].join(':')
54
53
  end
55
54
 
55
+ def average(estimates)
56
+ estimates.map(&:to_i).inject(:+).to_f / estimates.size
57
+ end
58
+
56
59
  Lita.register_handler(self)
57
60
  end
58
61
  end
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |spec|
2
2
  spec.name = "lita-estimate"
3
- spec.version = "0.1.5"
3
+ spec.version = "0.1.6"
4
4
  spec.authors = ["Ingo Weiss"]
5
5
  spec.email = ["ingo@ingoweiss.com"]
6
6
  spec.description = "Just a silly little Lita plugin for estimation"
@@ -43,9 +43,9 @@ describe Lita::Handlers::Estimate, lita_handler: true do
43
43
  subject.redis.hset('estimate:US123', 'Paula', '3')
44
44
  send_command('US123 estimates')
45
45
  expect(lines(replies.last)).to eq([
46
- "Paula: 3",
47
- "Peter: 5",
48
- "Average: 4.0"
46
+ "3 (Paula)",
47
+ "5 (Peter)",
48
+ "4.0 Average"
49
49
  ])
50
50
  end
51
51
 
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.5
4
+ version: 0.1.6
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-29 00:00:00.000000000 Z
11
+ date: 2015-10-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: lita