lita-team 0.1.0 → 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: 945a062a82c4db6d0ea8824c4ee928502a508384
4
- data.tar.gz: 6414a2e1ae7767ef9ffab0efd839d922a7eb16f2
3
+ metadata.gz: 3063c4d97c93c2aec90fbca5c5cd0187be403e8b
4
+ data.tar.gz: c81a31b980fbac18ce25920033b69518657348d9
5
5
  SHA512:
6
- metadata.gz: 680f79f31744eaaf86e3e7c651c7e01fdb2e9c34f5a8499e4eaa384f08ac60cc36e8079a0fe8c4201b50a62cc452ff0df5470daf1af9e100c4e2094b5f588436
7
- data.tar.gz: eada9f3670d8ccc07d56bce78e093dfa68a260824cdf10c4d8b1fdbe8a036989903bef727bca68b420c228ebd321d264d9b547b7d5bfb77f78e7d2567aea02f6
6
+ metadata.gz: 3018309d640b32259fde30ccaf450515615fbd620398908b1ae0e5f3c887a4ad311f27f433f8e06b5e389efedcb0803f774cccf650eeaf9daeac0547118020c1
7
+ data.tar.gz: cde6b8fbcf5a6255981927ee0e50082398ada98d0ba33df1af6a58e331e40e8794160582445a549e0263c7071050f6a4a974bcaa22f9fb4e1f4f39576e77ce79
data/.ruby-gemset ADDED
@@ -0,0 +1 @@
1
+ lita-team
data/.ruby-version ADDED
@@ -0,0 +1 @@
1
+ 2.2.2
data/.travis.yml CHANGED
@@ -1,7 +1,7 @@
1
1
  language: ruby
2
2
  cache: bundler
3
3
  rvm:
4
- - 2.0.0
4
+ - 2.2.2
5
5
  script: bundle exec rake
6
6
  before_install:
7
7
  - gem update --system
data/README.md CHANGED
@@ -2,6 +2,7 @@
2
2
 
3
3
  [![Build Status](https://travis-ci.org/EdgarOrtegaRamirez/lita-team.svg?branch=master)](https://travis-ci.org/EdgarOrtegaRamirez/lita-team)
4
4
  [![Coverage Status](https://coveralls.io/repos/EdgarOrtegaRamirez/lita-team/badge.svg?branch=master)](https://coveralls.io/r/EdgarOrtegaRamirez/lita-team?branch=master)
5
+ [![Code Climate](https://codeclimate.com/github/EdgarOrtegaRamirez/lita-team/badges/gpa.svg)](https://codeclimate.com/github/EdgarOrtegaRamirez/lita-team)
5
6
 
6
7
  Create and manage the members of a team with Lita
7
8
 
@@ -0,0 +1,38 @@
1
+ module Lita
2
+ module Actions
3
+ class AddMemberToTeam < Base
4
+
5
+ def call
6
+ if team
7
+ count_was = team.members.count
8
+ if create_member
9
+ response.reply render_template(:member_added_to_team, member: member_name, team: team_name, count: count_was)
10
+ else
11
+ response.reply t(:member_already_in_team, member: member_name, team: team_name)
12
+ end
13
+ else
14
+ response.reply t(:team_not_found, name: team_name)
15
+ end
16
+ end
17
+
18
+ private
19
+
20
+ def team_name
21
+ response.match_data[1]
22
+ end
23
+
24
+ def member_name
25
+ response.match_data[3] || response.user.mention_name
26
+ end
27
+
28
+ def team
29
+ @team ||= Lita::Team.find(team_name)
30
+ end
31
+
32
+ def create_member
33
+ Lita::Store::Member.create(member_name: member_name, team_name: team_name)
34
+ end
35
+
36
+ end
37
+ end
38
+ end
@@ -0,0 +1,28 @@
1
+ module Lita
2
+ module Actions
3
+ class Base
4
+ include Lita::Handler::Common
5
+
6
+ attr :response
7
+ @@template_root = nil
8
+
9
+ def initialize(response)
10
+ @response = response
11
+ end
12
+
13
+ def self.template_root(path = nil)
14
+ @@template_root = path if path
15
+ @@template_root
16
+ end
17
+
18
+ def robot
19
+ response.message.instance_variable_get :"@robot"
20
+ end
21
+
22
+ def translate(key, options = {})
23
+ I18n.translate("lita.handlers.team.#{key}", options)
24
+ end
25
+ alias_method :t, :translate
26
+ end
27
+ end
28
+ end
@@ -0,0 +1,30 @@
1
+ module Lita
2
+ module Actions
3
+ class ClearTeam < Base
4
+
5
+ def call
6
+ if team_exists?
7
+ destroy_members
8
+ response.reply t(:team_cleared, name: team_name)
9
+ else
10
+ response.reply t(:team_not_found, name: team_name)
11
+ end
12
+ end
13
+
14
+ private
15
+
16
+ def team_name
17
+ response.match_data[1]
18
+ end
19
+
20
+ def team_exists?
21
+ Lita::Team.find(team_name)
22
+ end
23
+
24
+ def destroy_members
25
+ Lita::Store::Member.destroy_all(team_name: team_name)
26
+ end
27
+
28
+ end
29
+ end
30
+ end
@@ -0,0 +1,21 @@
1
+ module Lita
2
+ module Actions
3
+ class CreateTeam < Base
4
+
5
+ def call
6
+ if Lita::Store::Team.create(team_name)
7
+ response.reply t(:team_created, name: team_name)
8
+ else
9
+ response.reply t(:team_already_exists, name: team_name)
10
+ end
11
+ end
12
+
13
+ private
14
+
15
+ def team_name
16
+ response.match_data[1]
17
+ end
18
+
19
+ end
20
+ end
21
+ end
@@ -0,0 +1,21 @@
1
+ module Lita
2
+ module Actions
3
+ class DeleteTeam < Base
4
+
5
+ def call
6
+ if Lita::Store::Team.destroy(team_name)
7
+ response.reply t(:team_deleted, name: team_name)
8
+ else
9
+ response.reply t(:team_not_found, name: team_name)
10
+ end
11
+ end
12
+
13
+ private
14
+
15
+ def team_name
16
+ response.match_data[2]
17
+ end
18
+
19
+ end
20
+ end
21
+ end
@@ -0,0 +1,25 @@
1
+ module Lita
2
+ module Actions
3
+ class ListTeam < Base
4
+
5
+ def call
6
+ if team
7
+ response.reply render_template(:list_team, team: team)
8
+ else
9
+ response.reply t(:team_not_found, name: team_name)
10
+ end
11
+ end
12
+
13
+ private
14
+
15
+ def team_name
16
+ response.match_data[1]
17
+ end
18
+
19
+ def team
20
+ @team ||= Lita::Team.find(team_name)
21
+ end
22
+
23
+ end
24
+ end
25
+ end
@@ -0,0 +1,11 @@
1
+ module Lita
2
+ module Actions
3
+ class ListTeams < Base
4
+
5
+ def call
6
+ response.reply render_template(:list_teams, teams: Lita::Team.all)
7
+ end
8
+
9
+ end
10
+ end
11
+ end
@@ -0,0 +1,37 @@
1
+ module Lita
2
+ module Actions
3
+ class RemoveMemberFromTeam < Base
4
+
5
+ def call
6
+ if team
7
+ if destroy_member
8
+ response.reply render_template(:member_removed_from_team, member: member_name, team: team)
9
+ else
10
+ response.reply t(:member_already_out_of_team, member: member_name, team: team_name)
11
+ end
12
+ else
13
+ response.reply t(:team_not_found, name: team_name)
14
+ end
15
+ end
16
+
17
+ private
18
+
19
+ def team_name
20
+ response.match_data[1]
21
+ end
22
+
23
+ def member_name
24
+ response.match_data[3] || response.user.mention_name
25
+ end
26
+
27
+ def team
28
+ @team ||= Lita::Team.find(team_name)
29
+ end
30
+
31
+ def destroy_member
32
+ Lita::Store::Member.destroy(member_name: member_name, team_name: team_name)
33
+ end
34
+
35
+ end
36
+ end
37
+ end
@@ -1,116 +1,55 @@
1
1
  module Lita
2
2
  module Handlers
3
- class Team < Handler
3
+ class Team
4
+ extend Lita::Handler::ChatRouter
4
5
 
5
- route(/create (\S*) team/i, :create_team, command: true, help: {
6
+ route(/create (\S*) team/i, command: true, help: {
6
7
  "create <name> team" => "create team called <name>"
7
- })
8
- route(/(delete|remove) (\S*) team/i, :delete_team, command: true, help: {
8
+ }) do |response|
9
+ Lita::Actions::CreateTeam.new(response).call
10
+ end
11
+
12
+ route(/(delete|remove) (\S*) team/i, command: true, help: {
9
13
  "delete <name> team" => "delete team called <name>",
10
14
  "remove <name> team" => "delete team called <name>",
11
- })
12
- route(/list teams/i, :list_teams, command: true, help: {
15
+ }) do |response|
16
+ Lita::Actions::DeleteTeam.new(response).call
17
+ end
18
+
19
+ route(/list teams/i, command: true, help: {
13
20
  "list teams" => "list all teams"
14
- })
15
- route(/(\S*)? team (\+1|add me|add (\S*))/i, :add_member_to_team, command: true, help: {
21
+ }) do |response|
22
+ Lita::Actions::ListTeams.new(response).call
23
+ end
24
+
25
+ route(/(\S*) team (\+1|add me|add (\S*))/i, command: true, help: {
16
26
  "<name> team +1" => "add me to team",
17
27
  "<name> team add me" => "add me to team",
18
28
  "<name> team add <user>" => "add user to team",
19
- })
20
- route(/(\S*)? team (-1|remove me|remove (\S*))/i, :remove_member_from_team, command: true, help: {
29
+ }) do |response|
30
+ Lita::Actions::AddMemberToTeam.new(response).call
31
+ end
32
+
33
+ route(/(\S*) team (-1|remove me|remove (\S*))/i, command: true, help: {
21
34
  "<name> team -1" => "remove me from team",
22
35
  "<name> team remove me" => "remove me from team",
23
36
  "<name> team remove <user>" => "remove <user> from team",
24
- })
25
- route(/(\S*)? team (list|show)/i, :list_team, command: true, help: {
26
- "<name> team list" => "list the people in the team",
27
- "<name> team show" => "list the people in the team",
28
- })
29
- route(/(\S*)? team (clear|empty)/i, :clear_team, command: true, help: {
30
- "<name> team clear" => "clear team list",
31
- "<name> team empty" => "clear team list",
32
- })
33
-
34
- def create_team(response)
35
- team = Lita::Team.new(response.match_data[1])
36
- if redis.hsetnx(team.key, :name, team.name)
37
- response.reply t(:team_created, name: team.display_name)
38
- else
39
- response.reply t(:team_already_exists, name: team.display_name)
40
- end
37
+ }) do |response|
38
+ Lita::Actions::RemoveMemberFromTeam.new(response).call
41
39
  end
42
40
 
43
- def delete_team(response)
44
- team = Lita::Team.new(response.match_data[2])
45
- if redis.exists(team.key)
46
- redis.del team.key
47
- response.reply t(:team_deleted, name: team.display_name)
48
- else
49
- response.reply t(:team_not_found, name: team.display_name)
50
- end
51
- end
52
-
53
- def list_teams(response)
54
- keys = redis.keys "team*"
55
- teams = keys.map do |key|
56
- team_data = redis.hgetall(key)
57
- Lita::Team.new(team_data["name"])
58
- end
59
- response.reply render_template(:list_teams, teams: teams)
60
- end
61
-
62
- def add_member_to_team(response)
63
- team = Lita::Team.new(response.match_data[1])
64
- if redis.exists(team.key)
65
- user = response.match_data[3] ? response.match_data[3] : response.user.name
66
- count_was = redis.scard(team.members_key)
67
- if redis.sadd(team.members_key, user)
68
- message = t(:member_added_to_team, user: user, team: team.display_name)
69
- message << t(:members_in_team, count: count_was) if count_was > 0
70
- response.reply message
71
- else
72
- response.reply t(:member_already_in_team, user: user, team: team.display_name)
73
- end
74
- else
75
- response.reply t(:team_not_found, name: team.display_name)
76
- end
77
- end
78
-
79
- def remove_member_from_team(response)
80
- team = Lita::Team.new(response.match_data[1])
81
- if redis.exists(team.key)
82
- user = response.match_data[3] ? response.match_data[3] : response.user.name
83
- if redis.srem(team.members_key, user)
84
- remaining = redis.scard(team.members_key)
85
- message = t(:member_removed_from_team, user: user, team: team.display_name)
86
- message << t(:members_in_team, count: remaining) if remaining > 0
87
- response.reply message
88
- else
89
- response.reply t(:member_already_out_of_team, user: user, team: team.display_name)
90
- end
91
- else
92
- response.reply t(:team_not_found, name: team.display_name)
93
- end
94
- end
95
-
96
- def list_team(response)
97
- team = Lita::Team.new(response.match_data[1])
98
- if redis.exists(team.key)
99
- members = redis.smembers(team.members_key)
100
- response.reply render_template(:list_team, team: team.display_name, members: members)
101
- else
102
- response.reply t(:team_not_found, name: team.display_name)
103
- end
41
+ route(/(\S*) team (list|show)/i, command: true, help: {
42
+ "<name> team list" => "list the people in the team",
43
+ "<name> team show" => "list the people in the team",
44
+ }) do |response|
45
+ Lita::Actions::ListTeam.new(response).call
104
46
  end
105
47
 
106
- def clear_team(response)
107
- team = Lita::Team.new(response.match_data[1])
108
- if redis.exists(team.key)
109
- redis.del(team.members_key)
110
- response.reply t(:team_cleared, name: team.display_name)
111
- else
112
- response.reply t(:team_not_found, name: team.display_name)
113
- end
48
+ route(/(\S*) team (clear|empty)/i, command: true, help: {
49
+ "<name> team clear" => "clear team list",
50
+ "<name> team empty" => "clear team list",
51
+ }) do |response|
52
+ Lita::Actions::ClearTeam.new(response).call
114
53
  end
115
54
  end
116
55
 
@@ -0,0 +1,17 @@
1
+ module Lita
2
+ class Member
3
+ attr :name
4
+
5
+ def initialize(name)
6
+ @name = name
7
+ end
8
+
9
+ class << self
10
+ def all(team_name:)
11
+ Lita::Store::Member.all(team_name: team_name).map do |data|
12
+ new(data["name"])
13
+ end
14
+ end
15
+ end
16
+ end
17
+ end
@@ -0,0 +1,32 @@
1
+ module Lita
2
+ module Store
3
+ module Member
4
+ extend self
5
+
6
+ def redis
7
+ @redis ||= Redis::Namespace.new("handlers:team:member", redis: Lita.redis)
8
+ end
9
+
10
+ def create(member_name:, team_name:)
11
+ redis.hsetnx("#{ team_name }:#{ member_name }", :name, member_name)
12
+ end
13
+
14
+ def destroy(member_name:, team_name:)
15
+ redis.del("#{ team_name }:#{ member_name }") != 0
16
+ end
17
+
18
+ def destroy_all(team_name:)
19
+ redis.keys("#{ team_name }:*").each do |key|
20
+ redis.del(key)
21
+ end
22
+ end
23
+
24
+ def all(team_name:)
25
+ redis.keys("#{ team_name }:*").sort.map do |key|
26
+ redis.hgetall(key)
27
+ end
28
+ end
29
+
30
+ end
31
+ end
32
+ end
@@ -0,0 +1,34 @@
1
+ module Lita
2
+ module Store
3
+ module Team
4
+ extend self
5
+
6
+ def redis
7
+ @redis ||= Redis::Namespace.new("handlers:team:team", redis: Lita.redis)
8
+ end
9
+
10
+ def find(team_name)
11
+ redis.hgetall(team_name)
12
+ end
13
+
14
+ def exists?(team_name)
15
+ redis.exists(team_name)
16
+ end
17
+
18
+ def create(team_name)
19
+ redis.hsetnx(team_name, :name, team_name)
20
+ end
21
+
22
+ def destroy(team_name)
23
+ redis.del(team_name) != 0
24
+ end
25
+
26
+ def all
27
+ redis.keys.sort.map do |key|
28
+ redis.hgetall(key)
29
+ end
30
+ end
31
+
32
+ end
33
+ end
34
+ end
data/lib/lita/team.rb CHANGED
@@ -1,15 +1,27 @@
1
1
  module Lita
2
- Team = Struct.new(:name) do
3
- def key
4
- "team:#{name}"
2
+ class Team
3
+ attr :name
4
+
5
+ def initialize(name)
6
+ @name = name
5
7
  end
6
8
 
7
- def members_key
8
- "members:#{name}"
9
+ class << self
10
+ def find(name)
11
+ return nil unless Lita::Store::Team.exists?(name)
12
+ new(Lita::Store::Team.find(name)["name"])
13
+ end
14
+
15
+ def all
16
+ Lita::Store::Team.all.map do |data|
17
+ new(data["name"])
18
+ end
19
+ end
9
20
  end
10
21
 
11
- def display_name
12
- "#{name} team"
22
+ def members
23
+ @members ||= Lita::Member.all(team_name: name)
13
24
  end
25
+
14
26
  end
15
27
  end
data/lib/lita-team.rb CHANGED
@@ -4,10 +4,22 @@ Lita.load_locales Dir[File.expand_path(
4
4
  File.join("..", "..", "locales", "*.yml"), __FILE__
5
5
  )]
6
6
 
7
- require "lita/team"
8
7
  require "lita/handlers/team"
8
+ require "lita/actions/base"
9
+ require "lita/actions/create_team"
10
+ require "lita/actions/delete_team"
11
+ require "lita/actions/list_team"
12
+ require "lita/actions/clear_team"
13
+ require "lita/actions/list_teams"
14
+ require "lita/actions/add_member_to_team"
15
+ require "lita/actions/remove_member_from_team"
16
+ require "lita/store/team"
17
+ require "lita/store/member"
18
+ require "lita/team"
19
+ require "lita/member"
9
20
 
10
- Lita::Handlers::Team.template_root File.expand_path(
11
- File.join("..", "..", "templates"),
12
- __FILE__
21
+ template_root = File.expand_path(
22
+ File.join("..", "..", "templates"), __FILE__
13
23
  )
24
+ Lita::Actions::Base.template_root template_root
25
+ Lita::Handlers::Team.template_root template_root
data/lita-team.gemspec CHANGED
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |spec|
2
2
  spec.name = "lita-team"
3
- spec.version = "0.1.0"
3
+ spec.version = "1.0.0"
4
4
  spec.authors = ["Edgar Ortega"]
5
5
  spec.email = ["edgarortegaramirez@gmail.com"]
6
6
  spec.description = "create and manage the members of a team with Lita"
@@ -14,6 +14,8 @@ 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.required_ruby_version = '~> 2.0'
18
+
17
19
  spec.add_runtime_dependency "lita", ">= 4.3"
18
20
 
19
21
  spec.add_development_dependency "bundler", "~> 1.3"
data/locales/en.yml CHANGED
@@ -4,16 +4,19 @@ en:
4
4
  team:
5
5
  teams_title: "Teams:"
6
6
  no_teams_has_been_created: "No team has been created so far"
7
- team_not_found: "%{name} does not exist"
8
- team_created: "%{name} created, add some people to it"
9
- team_deleted: "%{name} deleted"
10
- team_already_exists: "%{name} already exists"
11
- member_already_in_team: "%{user} already in the %{team}"
12
- member_added_to_team: "%{user} added to the %{team}"
7
+ team_not_found: "%{name} team does not exist"
8
+ team_created: "%{name} team created, add some people to it"
9
+ team_deleted: "%{name} team deleted"
10
+ team_already_exists: "%{name} team already exists"
11
+ member_already_in_team: "%{member} already in the %{team} team"
12
+ member_added_to_team: "%{member} added to the %{team} team"
13
13
  members_in_team:
14
14
  one: ", 1 other is in"
15
15
  other: ", %{count} others are in"
16
- member_already_out_of_team: "%{user} already out of the %{team}"
17
- member_removed_from_team: "%{user} removed from the %{team}"
18
- team_empty: "There is no one in the %{team} currently"
19
- team_cleared: "%{name} cleared"
16
+ member_already_out_of_team: "%{member} already out of the %{team} team"
17
+ member_removed_from_team: "%{member} removed from the %{team} team"
18
+ team_empty: "There is no one in the %{team} team currently"
19
+ team_cleared: "%{name} team cleared"
20
+ team_summary:
21
+ one: "%{name} (1 member)"
22
+ other: "%{name} (%{count} members)"
@@ -1,23 +1,6 @@
1
1
  require "spec_helper"
2
2
 
3
3
  describe Lita::Handlers::Team, lita_handler: true do
4
- describe "routes" do
5
- it { is_expected.to route_command("create testing team").to(:create_team) }
6
- it { is_expected.to route_command("delete testing team").to(:delete_team) }
7
- it { is_expected.to route_command("remove testing team").to(:delete_team) }
8
- it { is_expected.to route_command("list teams").to(:list_teams) }
9
- it { is_expected.to route_command("testing team add person").to(:add_member_to_team) }
10
- it { is_expected.to route_command("testing team add me").to(:add_member_to_team) }
11
- it { is_expected.to route_command("testing team +1").to(:add_member_to_team) }
12
- it { is_expected.to route_command("testing team remove person").to(:remove_member_from_team) }
13
- it { is_expected.to route_command("testing team remove me").to(:remove_member_from_team) }
14
- it { is_expected.to route_command("testing team -1").to(:remove_member_from_team) }
15
- it { is_expected.to route_command("testing team list").to(:list_team) }
16
- it { is_expected.to route_command("testing team show").to(:list_team) }
17
- it { is_expected.to route_command("testing team clear").to(:clear_team) }
18
- it { is_expected.to route_command("testing team empty").to(:clear_team) }
19
- end
20
-
21
4
  describe "create team" do
22
5
  it "creates a new team" do
23
6
  send_command "create testing team"
@@ -53,7 +36,7 @@ describe Lita::Handlers::Team, lita_handler: true do
53
36
  send_command "create testing team"
54
37
  send_command "create qa team"
55
38
  send_command "list teams"
56
- expect(replies.last).to eq("Teams:\nqa\ntesting\n")
39
+ expect(replies.last).to eq("Teams:\nqa (0 members)\ntesting (0 members)\n")
57
40
  end
58
41
 
59
42
  context "without teams" do
@@ -178,10 +161,10 @@ describe Lita::Handlers::Team, lita_handler: true do
178
161
  describe "list team" do
179
162
  it "lists the members in the team" do
180
163
  send_command "create testing team"
181
- send_command "testing team add john"
182
164
  send_command "testing team add james"
165
+ send_command "testing team add john"
183
166
  send_command "testing team list"
184
- expect(replies.last).to eq("testing team (2 total):\n1. james\n2. john\n")
167
+ expect(replies.last).to eq("testing (2 members):\n1. james\n2. john\n")
185
168
  end
186
169
 
187
170
  context "team is empty" do
@@ -1,9 +1,9 @@
1
- <% if @members.empty? %>
2
- <%= I18n.translate("lita.handlers.team.team_empty", team: @team) %>
1
+ <% if @team.members.empty? %>
2
+ <%= I18n.t("lita.handlers.team.team_empty", team: @team.name) %>
3
3
  <% else %>
4
- <%= @team %> (<%= @members.count %> total):
5
- <% @members.each_with_index do |member, i| %>
6
- <%= i + 1 %>. <%= member %>
4
+ <%= I18n.t("lita.handlers.team.team_summary", name: @team.name, count: @team.members.count) %>:
5
+ <% @team.members.each_with_index do |member, i| %>
6
+ <%= i + 1 %>. <%= member.name %>
7
7
 
8
8
  <% end %>
9
9
  <% end %>
@@ -1,10 +1,10 @@
1
1
  <% if @teams.empty? %>
2
- <%= I18n.translate("lita.handlers.team.no_teams_has_been_created") %>
2
+ <%= I18n.t("lita.handlers.team.no_teams_has_been_created") %>
3
3
  <% else %>
4
- <%= I18n.translate("lita.handlers.team.teams_title") %>
4
+ <%= I18n.t("lita.handlers.team.teams_title") %>
5
5
 
6
6
  <% @teams.each do |team| %>
7
- <%= team.name %>
7
+ <%= I18n.t("lita.handlers.team.team_summary", name: team.name, count: team.members.count) %>
8
8
 
9
9
  <% end %>
10
10
  <% end %>
@@ -0,0 +1,4 @@
1
+ <%= I18n.t("lita.handlers.team.member_added_to_team", member: @member, team: @team) %>
2
+ <% if @count > 0 %>
3
+ <%= I18n.t("lita.handlers.team.members_in_team", count: @count) %>
4
+ <% end %>
@@ -0,0 +1,4 @@
1
+ <%= I18n.t("lita.handlers.team.member_removed_from_team", member: @member, team: @team.name) %>
2
+ <% if @team.members.count > 0 %>
3
+ <%= I18n.t("lita.handlers.team.members_in_team", count: @team.members.count) %>
4
+ <% end %>
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: lita-team
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 1.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Edgar Ortega
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-06-09 00:00:00.000000000 Z
11
+ date: 2015-06-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: lita
@@ -131,12 +131,25 @@ extra_rdoc_files: []
131
131
  files:
132
132
  - ".gitignore"
133
133
  - ".rspec"
134
+ - ".ruby-gemset"
135
+ - ".ruby-version"
134
136
  - ".travis.yml"
135
137
  - Gemfile
136
138
  - README.md
137
139
  - Rakefile
138
140
  - lib/lita-team.rb
141
+ - lib/lita/actions/add_member_to_team.rb
142
+ - lib/lita/actions/base.rb
143
+ - lib/lita/actions/clear_team.rb
144
+ - lib/lita/actions/create_team.rb
145
+ - lib/lita/actions/delete_team.rb
146
+ - lib/lita/actions/list_team.rb
147
+ - lib/lita/actions/list_teams.rb
148
+ - lib/lita/actions/remove_member_from_team.rb
139
149
  - lib/lita/handlers/team.rb
150
+ - lib/lita/member.rb
151
+ - lib/lita/store/member.rb
152
+ - lib/lita/store/team.rb
140
153
  - lib/lita/team.rb
141
154
  - lita-team.gemspec
142
155
  - locales/en.yml
@@ -145,6 +158,8 @@ files:
145
158
  - templates/.gitkeep
146
159
  - templates/list_team.erb
147
160
  - templates/list_teams.erb
161
+ - templates/member_added_to_team.erb
162
+ - templates/member_removed_from_team.erb
148
163
  homepage: https://github.com/EdgarOrtegaRamirez/lita-team
149
164
  licenses:
150
165
  - MIT
@@ -156,9 +171,9 @@ require_paths:
156
171
  - lib
157
172
  required_ruby_version: !ruby/object:Gem::Requirement
158
173
  requirements:
159
- - - ">="
174
+ - - "~>"
160
175
  - !ruby/object:Gem::Version
161
- version: '0'
176
+ version: '2.0'
162
177
  required_rubygems_version: !ruby/object:Gem::Requirement
163
178
  requirements:
164
179
  - - ">="