sem 0.2.4 → 0.2.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/sem/api/team.rb +1 -1
- data/lib/sem/cli/shared_configs.rb +6 -1
- data/lib/sem/cli/teams.rb +6 -1
- data/lib/sem/version.rb +1 -1
- data/lib/sem/views/teams.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 06a7119f3c4f475331417ead5ac9aecb46e6d4b8
|
4
|
+
data.tar.gz: a6d80860bf7b81fddf2125140246774f08deb3a1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 99f9ffeb5a6e9e090a05ba5466591990738b79a397dbff7aac8c4cb4b33e3213f19f0dcca2c98cd3fbbcb074a1d39cc0c0e30344b1967cccfcbb282e6f564507
|
7
|
+
data.tar.gz: f46156f76e3c19c17059aa366ac30c11557ddb64cad0d7ecef687710621427547527900bbc9fec259cf4ee9f5904b2d5635369dcacd3016b58c15e3c1ca512d8
|
data/lib/sem/api/team.rb
CHANGED
@@ -42,7 +42,7 @@ class Sem::API::Team < SimpleDelegator
|
|
42
42
|
def update(args)
|
43
43
|
new_team = Sem::API::Base.client.teams.update(id, args)
|
44
44
|
|
45
|
-
raise Sem::Errors::ResourceNotUpdated.new("Team", [@org_name, name])
|
45
|
+
raise Sem::Errors::ResourceNotUpdated.new("Team", [@org_name, name]) unless new_team
|
46
46
|
|
47
47
|
self.class.new(@org_name, new_team)
|
48
48
|
end
|
@@ -27,8 +27,13 @@ class Sem::CLI::SharedConfigs < Dracula
|
|
27
27
|
|
28
28
|
desc "rename", "rename a shared configuration"
|
29
29
|
def rename(old_shared_config_name, new_shared_config_name)
|
30
|
+
old_org_name, _old_name = Sem::SRN.parse_shared_config(old_shared_config_name)
|
31
|
+
new_org_name, new_name = Sem::SRN.parse_shared_config(new_shared_config_name)
|
32
|
+
|
33
|
+
abort "Shared Configuration can't change its organization" unless new_org_name == old_org_name
|
34
|
+
|
30
35
|
shared_config = Sem::API::SharedConfig.find!(old_shared_config_name)
|
31
|
-
shared_config = shared_config.update!(:name =>
|
36
|
+
shared_config = shared_config.update!(:name => new_name)
|
32
37
|
|
33
38
|
Sem::Views::SharedConfigs.info(shared_config)
|
34
39
|
end
|
data/lib/sem/cli/teams.rb
CHANGED
@@ -30,8 +30,13 @@ class Sem::CLI::Teams < Dracula
|
|
30
30
|
|
31
31
|
desc "rename", "change the name of the team"
|
32
32
|
def rename(old_team_name, new_team_name)
|
33
|
+
old_org_name, _old_name = Sem::SRN.parse_team(old_team_name)
|
34
|
+
new_org_name, new_name = Sem::SRN.parse_team(new_team_name)
|
35
|
+
|
36
|
+
abort "Team can't change its organization" unless new_org_name == old_org_name
|
37
|
+
|
33
38
|
team = Sem::API::Team.find!(old_team_name)
|
34
|
-
team = team.update(:name =>
|
39
|
+
team = team.update(:name => new_name)
|
35
40
|
|
36
41
|
Sem::Views::Teams.info(team)
|
37
42
|
end
|
data/lib/sem/version.rb
CHANGED
data/lib/sem/views/teams.rb
CHANGED
@@ -23,7 +23,7 @@ class Sem::Views::Teams < Sem::Views::Base
|
|
23
23
|
["ID", team.id],
|
24
24
|
["Name", team.full_name],
|
25
25
|
["Permission", team.permission],
|
26
|
-
["Members", team.users.count
|
26
|
+
["Members", "#{team.users.count} members"],
|
27
27
|
["Created", team.created_at],
|
28
28
|
["Updated", team.updated_at]
|
29
29
|
]
|