lita-retro 0.0.1 → 1.0.0

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: 5d0cc52a998a8a5c2e66c4ae2438803d5eeadc2b
4
- data.tar.gz: 6d3431bf84f8edbefd250f93b2b703fe02bf57c9
3
+ metadata.gz: 3a1756b9cb9ba8418c3cf29042da3e3799fcdc25
4
+ data.tar.gz: d4da548e18094a314cd3fd3f1be1a6b5cdab0f31
5
5
  SHA512:
6
- metadata.gz: 868dbd9d744be861ace2710a963c5041db5736a16f000bf111590a81e8cdcbd50cfbded5ed58da669aac062306a62e2c3e940b961e28ef7dc4689a8c439cd92a
7
- data.tar.gz: 921ad61f7f7efdaefb06af4aedaea49dcd033c083c9ff2e3332afd7bcb9b9a47a6a36ec5396b65201fd30652efd8c1d9025dfc523903513c68265256d0cd04e8
6
+ metadata.gz: efb01dcce5e2d220cd3414a34cce09d900c34b65254ddfbdd1375e8ffb4d4b8499c69696a89c14d1bf9e9080bd5f1266126a3b20190c93ff55aa511120da927c
7
+ data.tar.gz: 5e902765d396f5962ce262bccec0df45ed12180ffa4b534975ed6101a4a555e92f6922ba197d20391db202b579930d0ee2c1cd9ca0b7dbce8090329625ee61e7
data/README.md CHANGED
@@ -27,6 +27,8 @@ Sophie: Lita retro :| What are we supposed to do during downtime?
27
27
  Lita: Neutral topic added!
28
28
  ```
29
29
 
30
+ Alternatively you could use `+`, `-`, and `=` instead of smiles.
31
+
30
32
  When it's time for the retro, ask Lita to list all the topics for you.
31
33
 
32
34
  ```
@@ -1,15 +1,15 @@
1
1
  module Lita
2
2
  module Handlers
3
3
  class Retro < Handler
4
- route /retro\s+:\)\s+(.+)/i, :add_good, command: true, help: {
4
+ route /retro\s+(?::\)|\+)\s+(.+)/i, :add_good, command: true, help: {
5
5
  t("help.add_good_key") => t("help.add_good_value")
6
6
  }
7
7
 
8
- route /retro\s+:\(\s+(.+)/i, :add_bad, command: true, help: {
8
+ route /retro\s+(?::\(|\-)\s+(.+)/i, :add_bad, command: true, help: {
9
9
  t("help.add_bad_key") => t("help.add_bad_value")
10
10
  }
11
11
 
12
- route /retro\s+:\|\s+(.+)/i, :add_neutral, command: true, help: {
12
+ route /retro\s+(?::\||\=)\s+(.+)/i, :add_neutral, command: true, help: {
13
13
  t("help.add_neutral_key") => t("help.add_neutral_value")
14
14
  }
15
15
 
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |spec|
2
2
  spec.name = "lita-retro"
3
- spec.version = "0.0.1"
3
+ spec.version = "1.0.0"
4
4
  spec.authors = ["Jimmy Cuadra"]
5
5
  spec.email = ["jimmy@jimmycuadra.com"]
6
6
  spec.description = %q{A Lita handler to help manage topics for regular team retrospective meetings.}
@@ -14,7 +14,7 @@ Gem::Specification.new do |spec|
14
14
  spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
15
15
  spec.require_paths = ["lib"]
16
16
 
17
- spec.add_runtime_dependency "lita", ">= 3.0"
17
+ spec.add_runtime_dependency "lita", ">= 4.0"
18
18
 
19
19
  spec.add_development_dependency "bundler", "~> 1.3"
20
20
  spec.add_development_dependency "rake"
@@ -3,11 +3,11 @@ en:
3
3
  handlers:
4
4
  retro:
5
5
  help:
6
- add_good_key: "retro :) TOPIC"
6
+ add_good_key: "retro :) TOPIC or retro + TOPIC"
7
7
  add_good_value: Add a positive topic for the next retrospective.
8
- add_bad_key: "retro :( TOPIC"
8
+ add_bad_key: "retro :( TOPIC or retro - TOPIC"
9
9
  add_bad_value: Add a negative topic for the next retrospective.
10
- add_neutral_key: "retro :| TOPIC"
10
+ add_neutral_key: "retro :| TOPIC or retro = TOPIC"
11
11
  add_neutral_value: Add a neutral topic for the next retrospective.
12
12
  list_value: List all topics for the next retrospective.
13
13
  clear_value: Clear the retrospective topics.
@@ -3,12 +3,17 @@ require "spec_helper"
3
3
  describe Lita::Handlers::Retro, lita_handler: true do
4
4
  let(:bad_user) { Lita::User.create(2, name: "Bad User") }
5
5
  let(:neutral_user) { Lita::User.create(3, name: "Neutral User") }
6
+ let(:retro_admin) do
7
+ user = Lita::User.create(3, name: "Retro Admin")
8
+ Lita::Authorization.new(registry.config).add_user_to_group!(user, :retro_admins)
9
+ user
10
+ end
6
11
 
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
+ it { is_expected.to route_command("retro :) topic").to(:add_good) }
13
+ it { is_expected.to route_command("retro :( topic").to(:add_bad) }
14
+ it { is_expected.to route_command("retro :| topic").to(:add_neutral) }
15
+ it { is_expected.to route_command("retro list").to(:list) }
16
+ it { is_expected.to route_command("retro clear").with_authorization_for(:retro_admins).to(:clear) }
12
17
 
13
18
  it "adds good topics" do
14
19
  send_command("retro :) foo bar")
@@ -39,14 +44,21 @@ describe Lita::Handlers::Retro, lita_handler: true do
39
44
  end
40
45
 
41
46
  it "clears all topics" do
42
- allow(Lita::Authorization).to receive(:user_in_group?).with(user, :retro_admins).and_return(
43
- true
44
- )
45
47
  send_command("retro :) something good!")
46
48
  send_command("retro :( something bad!", as: bad_user)
47
49
  send_command("retro :| something neutral!", as: neutral_user)
48
- send_command("retro clear")
50
+ send_command("retro clear", as: retro_admin)
49
51
  send_command("retro list")
50
52
  expect(replies.last).to eq("There are no retrospective topics yet.")
51
53
  end
54
+
55
+ it "supports +/-/= syntax" do
56
+ send_command("retro + something good!")
57
+ send_command("retro - something bad!", as: bad_user)
58
+ send_command("retro = something neutral!", as: neutral_user)
59
+ send_command("retro list")
60
+ expect(replies.last).to include("Good topic from Test User: something good!")
61
+ expect(replies.last).to include("Bad topic from Bad User: something bad!")
62
+ expect(replies.last).to include("Neutral topic from Neutral User: something neutral!")
63
+ end
52
64
  end
@@ -8,3 +8,5 @@ SimpleCov.start { add_filter "/spec/" }
8
8
 
9
9
  require "lita-retro"
10
10
  require "lita/rspec"
11
+
12
+ Lita.version_3_compatibility_mode = false
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: lita-retro
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 1.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jimmy Cuadra
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-03-01 00:00:00.000000000 Z
11
+ date: 2014-12-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: lita
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - ">="
18
18
  - !ruby/object:Gem::Version
19
- version: '3.0'
19
+ version: '4.0'
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - ">="
25
25
  - !ruby/object:Gem::Version
26
- version: '3.0'
26
+ version: '4.0'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: bundler
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -141,3 +141,4 @@ summary: A Lita handler to help manage topics for regular team retrospective mee
141
141
  test_files:
142
142
  - spec/lita/handlers/retro_spec.rb
143
143
  - spec/spec_helper.rb
144
+ has_rdoc: