lita-retro 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 5d0cc52a998a8a5c2e66c4ae2438803d5eeadc2b
4
+ data.tar.gz: 6d3431bf84f8edbefd250f93b2b703fe02bf57c9
5
+ SHA512:
6
+ metadata.gz: 868dbd9d744be861ace2710a963c5041db5736a16f000bf111590a81e8cdcbd50cfbded5ed58da669aac062306a62e2c3e940b961e28ef7dc4689a8c439cd92a
7
+ data.tar.gz: 921ad61f7f7efdaefb06af4aedaea49dcd033c083c9ff2e3332afd7bcb9b9a47a6a36ec5396b65201fd30652efd8c1d9025dfc523903513c68265256d0cd04e8
@@ -0,0 +1,18 @@
1
+ *.gem
2
+ *.rbc
3
+ .bundle
4
+ .config
5
+ .yardoc
6
+ Gemfile.lock
7
+ InstalledFiles
8
+ _yardoc
9
+ coverage
10
+ doc/
11
+ lib/bundler/man
12
+ pkg
13
+ rdoc
14
+ spec/reports
15
+ test/tmp
16
+ test/version_tmp
17
+ tmp
18
+ lita_config.rb
@@ -0,0 +1,8 @@
1
+ language: ruby
2
+ rvm:
3
+ - 2.0.0
4
+ script: bundle exec rake
5
+ before_install:
6
+ - gem update --system
7
+ services:
8
+ - redis-server
data/Gemfile ADDED
@@ -0,0 +1,3 @@
1
+ source "https://rubygems.org"
2
+
3
+ gemspec
data/LICENSE ADDED
@@ -0,0 +1,19 @@
1
+ Copyright (c) 2014 Jimmy Cuadra
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining a copy
4
+ of this software and associated documentation files (the "Software"), to deal
5
+ in the Software without restriction, including without limitation the rights
6
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7
+ copies of the Software, and to permit persons to whom the Software is
8
+ furnished to do so, subject to the following conditions:
9
+
10
+ The above copyright notice and this permission notice shall be included in
11
+ all copies or substantial portions of the Software.
12
+
13
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
19
+ THE SOFTWARE.
@@ -0,0 +1,50 @@
1
+ # lita-retro
2
+
3
+ [![Build Status](https://travis-ci.org/jimmycuadra/lita-retro.png?branch=master)](https://travis-ci.org/jimmycuadra/lita-retro)
4
+ [![Code Climate](https://codeclimate.com/github/jimmycuadra/lita-retro.png)](https://codeclimate.com/github/jimmycuadra/lita-retro)
5
+ [![Coverage Status](https://coveralls.io/repos/jimmycuadra/lita-retro/badge.png)](https://coveralls.io/r/jimmycuadra/lita-retro)
6
+
7
+ **lita-retro** helps manage topics for regular team retrospective meetings.
8
+
9
+ ## Installation
10
+
11
+ Add lita-retro to your Lita instance's Gemfile:
12
+
13
+ ``` ruby
14
+ gem "lita-retro"
15
+ ```
16
+
17
+ ## Usage
18
+
19
+ Throughout the week, team members may think of things they'd like to discuss at the next team retro. They can store their topic ideas with Lita and Lita will list all the topics when it comes time to meet and discuss them. Topics can be classified as good, bad, or neutral, signified by a happy face, a sad face, or a straight face, respectively.
20
+
21
+ ```
22
+ Carl: Lita retro :) Our new documentation was super useful!
23
+ Lita: Good topic added!
24
+ Henry: Lita retro :( There were too many interruptions.
25
+ Lita: Bad topic added!
26
+ Sophie: Lita retro :| What are we supposed to do during downtime?
27
+ Lita: Neutral topic added!
28
+ ```
29
+
30
+ When it's time for the retro, ask Lita to list all the topics for you.
31
+
32
+ ```
33
+ You: Lita retro list
34
+ Lita: Good topic from Carl: Our new documentation was super useful!
35
+ Bad topic from Henry: There were too many interruptions.
36
+ Neutral topic from Sophie: What are we supposed to do during downtime?
37
+ ```
38
+
39
+ After the meeting, clear the topics and begin collecting them for the following week. Only users in the `:retro_admins` authorization group can do this.
40
+
41
+ ```
42
+ You: Lita retro clear
43
+ Lita: Cleared all topics!
44
+ You: Lita retro list
45
+ Lita: There are no retrospective topics yet.
46
+ ```
47
+
48
+ ## License
49
+
50
+ [MIT](http://opensource.org/licenses/MIT)
@@ -0,0 +1,6 @@
1
+ require "bundler/gem_tasks"
2
+ require "rspec/core/rake_task"
3
+
4
+ RSpec::Core::RakeTask.new(:spec)
5
+
6
+ task default: :spec
@@ -0,0 +1,7 @@
1
+ require "lita"
2
+
3
+ Lita.load_locales Dir[File.expand_path(
4
+ File.join("..", "..", "locales", "*.yml"), __FILE__
5
+ )]
6
+
7
+ require "lita/handlers/retro"
@@ -0,0 +1,89 @@
1
+ module Lita
2
+ module Handlers
3
+ class Retro < Handler
4
+ route /retro\s+:\)\s+(.+)/i, :add_good, command: true, help: {
5
+ t("help.add_good_key") => t("help.add_good_value")
6
+ }
7
+
8
+ route /retro\s+:\(\s+(.+)/i, :add_bad, command: true, help: {
9
+ t("help.add_bad_key") => t("help.add_bad_value")
10
+ }
11
+
12
+ route /retro\s+:\|\s+(.+)/i, :add_neutral, command: true, help: {
13
+ t("help.add_neutral_key") => t("help.add_neutral_value")
14
+ }
15
+
16
+ route /retro\s+list/i, :list, command: true, help: {
17
+ "retro list" => t("help.list_value")
18
+ }
19
+
20
+ route /retro\s+clear/i, :clear, command: true, restrict_to: :retro_admins, help: {
21
+ "retro clear" => t("help.clear_value")
22
+ }
23
+
24
+ def add_bad(response)
25
+ add_type("bad", response)
26
+ end
27
+
28
+ def add_good(response)
29
+ add_type("good", response)
30
+ end
31
+
32
+ def add_neutral(response)
33
+ add_type("neutral", response)
34
+ end
35
+
36
+ def list(response)
37
+ topics = [
38
+ list_type("good"),
39
+ list_type("bad"),
40
+ list_type("neutral")
41
+ ].compact
42
+
43
+ if topics.empty?
44
+ response.reply(t("no_topics"))
45
+ else
46
+ response.reply(topics.join("\n"))
47
+ end
48
+ end
49
+
50
+ def clear(response)
51
+ %w(good bad neutral).map do |type|
52
+ redis.smembers(type).each { |id| redis.del("#{type}:#{id}") }
53
+ redis.del(type)
54
+ end
55
+
56
+ response.reply(t("clear"))
57
+ end
58
+
59
+ private
60
+
61
+ def add_type(type, response)
62
+ redis.sadd("#{type}:#{response.user.id}", response.matches[0][0])
63
+ redis.sadd("#{type}", response.user.id)
64
+ response.reply(t("added", type: type))
65
+ end
66
+
67
+ def list_type(type)
68
+ user_ids = redis.smembers(type)
69
+ return if user_ids.empty?
70
+
71
+ topics = []
72
+
73
+ user_ids.each do |user_id|
74
+ user = User.find_by_id(user_id)
75
+ next unless user
76
+
77
+ redis.smembers("#{type}:#{user.id}").each do |topic|
78
+ topics << t("topic", type: type.capitalize, name: user.name, topic: topic)
79
+ end
80
+ end
81
+
82
+ topics.join("\n")
83
+ end
84
+ end
85
+
86
+ Lita.register_handler(Retro)
87
+ end
88
+ end
89
+
@@ -0,0 +1,24 @@
1
+ Gem::Specification.new do |spec|
2
+ spec.name = "lita-retro"
3
+ spec.version = "0.0.1"
4
+ spec.authors = ["Jimmy Cuadra"]
5
+ spec.email = ["jimmy@jimmycuadra.com"]
6
+ spec.description = %q{A Lita handler to help manage topics for regular team retrospective meetings.}
7
+ spec.summary = %q{A Lita handler to help manage topics for regular team retrospective meetings.}
8
+ spec.homepage = "https://github.com/jimmycuadra/lita-retro"
9
+ spec.license = "MIT"
10
+ spec.metadata = { "lita_plugin_type" => "handler" }
11
+
12
+ spec.files = `git ls-files`.split($/)
13
+ spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
14
+ spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
15
+ spec.require_paths = ["lib"]
16
+
17
+ spec.add_runtime_dependency "lita", ">= 3.0"
18
+
19
+ spec.add_development_dependency "bundler", "~> 1.3"
20
+ spec.add_development_dependency "rake"
21
+ spec.add_development_dependency "rspec", ">= 3.0.0.beta2"
22
+ spec.add_development_dependency "simplecov"
23
+ spec.add_development_dependency "coveralls"
24
+ end
@@ -0,0 +1,17 @@
1
+ en:
2
+ lita:
3
+ handlers:
4
+ retro:
5
+ help:
6
+ add_good_key: "retro :) TOPIC"
7
+ add_good_value: Add a positive topic for the next retrospective.
8
+ add_bad_key: "retro :( TOPIC"
9
+ add_bad_value: Add a negative topic for the next retrospective.
10
+ add_neutral_key: "retro :| TOPIC"
11
+ add_neutral_value: Add a neutral topic for the next retrospective.
12
+ list_value: List all topics for the next retrospective.
13
+ clear_value: Clear the retrospective topics.
14
+ added: "Added %{type} topic!"
15
+ topic: "%{type} topic from %{name}: %{topic}"
16
+ no_topics: There are no retrospective topics yet.
17
+ clear: Cleared all topics!
@@ -0,0 +1,52 @@
1
+ require "spec_helper"
2
+
3
+ describe Lita::Handlers::Retro, lita_handler: true do
4
+ let(:bad_user) { Lita::User.create(2, name: "Bad User") }
5
+ let(:neutral_user) { Lita::User.create(3, name: "Neutral User") }
6
+
7
+ it { routes_command("retro :) topic").to(:add_good) }
8
+ it { routes_command("retro :( topic").to(:add_bad) }
9
+ it { routes_command("retro :| topic").to(:add_neutral) }
10
+ it { routes_command("retro list").to(:list) }
11
+ it { routes_command("retro clear").to(:clear) }
12
+
13
+ it "adds good topics" do
14
+ send_command("retro :) foo bar")
15
+ send_command("retro list")
16
+ expect(replies.last).to eq("Good topic from Test User: foo bar")
17
+ end
18
+
19
+ it "adds bad topics" do
20
+ send_command("retro :( foo bar")
21
+ send_command("retro list")
22
+ expect(replies.last).to eq("Bad topic from Test User: foo bar")
23
+ end
24
+
25
+ it "adds neutral topics" do
26
+ send_command("retro :| foo bar")
27
+ send_command("retro list")
28
+ expect(replies.last).to eq("Neutral topic from Test User: foo bar")
29
+ end
30
+
31
+ it "lists all topics" do
32
+ send_command("retro :) something good!")
33
+ send_command("retro :( something bad!", as: bad_user)
34
+ send_command("retro :| something neutral!", as: neutral_user)
35
+ send_command("retro list")
36
+ expect(replies.last).to include("Good topic from Test User: something good!")
37
+ expect(replies.last).to include("Bad topic from Bad User: something bad!")
38
+ expect(replies.last).to include("Neutral topic from Neutral User: something neutral!")
39
+ end
40
+
41
+ it "clears all topics" do
42
+ allow(Lita::Authorization).to receive(:user_in_group?).with(user, :retro_admins).and_return(
43
+ true
44
+ )
45
+ send_command("retro :) something good!")
46
+ send_command("retro :( something bad!", as: bad_user)
47
+ send_command("retro :| something neutral!", as: neutral_user)
48
+ send_command("retro clear")
49
+ send_command("retro list")
50
+ expect(replies.last).to eq("There are no retrospective topics yet.")
51
+ end
52
+ end
@@ -0,0 +1,10 @@
1
+ require "simplecov"
2
+ require "coveralls"
3
+ SimpleCov.formatter = SimpleCov::Formatter::MultiFormatter[
4
+ SimpleCov::Formatter::HTMLFormatter,
5
+ Coveralls::SimpleCov::Formatter
6
+ ]
7
+ SimpleCov.start { add_filter "/spec/" }
8
+
9
+ require "lita-retro"
10
+ require "lita/rspec"
metadata ADDED
@@ -0,0 +1,143 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: lita-retro
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ platform: ruby
6
+ authors:
7
+ - Jimmy Cuadra
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2014-03-01 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: lita
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ">="
18
+ - !ruby/object:Gem::Version
19
+ version: '3.0'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ">="
25
+ - !ruby/object:Gem::Version
26
+ version: '3.0'
27
+ - !ruby/object:Gem::Dependency
28
+ name: bundler
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: '1.3'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: '1.3'
41
+ - !ruby/object:Gem::Dependency
42
+ name: rake
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - ">="
46
+ - !ruby/object:Gem::Version
47
+ version: '0'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - ">="
53
+ - !ruby/object:Gem::Version
54
+ version: '0'
55
+ - !ruby/object:Gem::Dependency
56
+ name: rspec
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - ">="
60
+ - !ruby/object:Gem::Version
61
+ version: 3.0.0.beta2
62
+ type: :development
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - ">="
67
+ - !ruby/object:Gem::Version
68
+ version: 3.0.0.beta2
69
+ - !ruby/object:Gem::Dependency
70
+ name: simplecov
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - ">="
74
+ - !ruby/object:Gem::Version
75
+ version: '0'
76
+ type: :development
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - ">="
81
+ - !ruby/object:Gem::Version
82
+ version: '0'
83
+ - !ruby/object:Gem::Dependency
84
+ name: coveralls
85
+ requirement: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - ">="
88
+ - !ruby/object:Gem::Version
89
+ version: '0'
90
+ type: :development
91
+ prerelease: false
92
+ version_requirements: !ruby/object:Gem::Requirement
93
+ requirements:
94
+ - - ">="
95
+ - !ruby/object:Gem::Version
96
+ version: '0'
97
+ description: A Lita handler to help manage topics for regular team retrospective meetings.
98
+ email:
99
+ - jimmy@jimmycuadra.com
100
+ executables: []
101
+ extensions: []
102
+ extra_rdoc_files: []
103
+ files:
104
+ - ".gitignore"
105
+ - ".travis.yml"
106
+ - Gemfile
107
+ - LICENSE
108
+ - README.md
109
+ - Rakefile
110
+ - lib/lita-retro.rb
111
+ - lib/lita/handlers/retro.rb
112
+ - lita-retro.gemspec
113
+ - locales/en.yml
114
+ - spec/lita/handlers/retro_spec.rb
115
+ - spec/spec_helper.rb
116
+ homepage: https://github.com/jimmycuadra/lita-retro
117
+ licenses:
118
+ - MIT
119
+ metadata:
120
+ lita_plugin_type: handler
121
+ post_install_message:
122
+ rdoc_options: []
123
+ require_paths:
124
+ - lib
125
+ required_ruby_version: !ruby/object:Gem::Requirement
126
+ requirements:
127
+ - - ">="
128
+ - !ruby/object:Gem::Version
129
+ version: '0'
130
+ required_rubygems_version: !ruby/object:Gem::Requirement
131
+ requirements:
132
+ - - ">="
133
+ - !ruby/object:Gem::Version
134
+ version: '0'
135
+ requirements: []
136
+ rubyforge_project:
137
+ rubygems_version: 2.2.2
138
+ signing_key:
139
+ specification_version: 4
140
+ summary: A Lita handler to help manage topics for regular team retrospective meetings.
141
+ test_files:
142
+ - spec/lita/handlers/retro_spec.rb
143
+ - spec/spec_helper.rb