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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 6c386662fdc6f698a75d2a465bf2341995130638
4
- data.tar.gz: 8042f7c3359a3ff026658784aed2950fd6b36d7d
3
+ metadata.gz: 06a7119f3c4f475331417ead5ac9aecb46e6d4b8
4
+ data.tar.gz: a6d80860bf7b81fddf2125140246774f08deb3a1
5
5
  SHA512:
6
- metadata.gz: 9c29dda2661f328865b4671e5da73d5bfb50a5d68619f9201a72c14aad2fd07f2382c7ddb65ce4a96616e70d0952789055d7e95db1ba5a8547307d69afdfb1c7
7
- data.tar.gz: 61246d6688a5618bdafb366d56855ad8553c05f8b037ad652b00d698a81db2e53dfc47e5269ef5cdd925509c390fa4a0a197bf6cb0145edbf048c89b39417159
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]) if new_team.nil?
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 => new_shared_config_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 => new_team_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
@@ -1,3 +1,3 @@
1
1
  module Sem
2
- VERSION = "0.2.4".freeze
2
+ VERSION = "0.2.5".freeze
3
3
  end
@@ -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.to_s],
26
+ ["Members", "#{team.users.count} members"],
27
27
  ["Created", team.created_at],
28
28
  ["Updated", team.updated_at]
29
29
  ]
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sem
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.4
4
+ version: 0.2.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Igor Šarčević