Class: Sem::CLI::Teams::SharedConfigs

Inherits:
Dracula
  • Object
show all
Defined in:
lib/sem/cli/teams.rb

Instance Method Summary collapse

Instance Method Details

#add(team_name, shared_config_name) ⇒ Object



286
287
288
289
290
291
292
293
# File 'lib/sem/cli/teams.rb', line 286

def add(team_name, shared_config_name)
  team = Sem::API::Team.find!(team_name)
  shared_config = Sem::API::SharedConfig.find!(shared_config_name)

  team.add_shared_config(shared_config)

  puts "Shared Configuration #{shared_config_name} added to the team."
end

#list(team_name) ⇒ Object



268
269
270
271
272
273
274
275
276
277
# File 'lib/sem/cli/teams.rb', line 268

def list(team_name)
  team = Sem::API::Team.find!(team_name)
  configs = team.shared_configs

  if !configs.empty?
    Sem::Views::SharedConfigs.list(configs)
  else
    Sem::Views::Teams.add_first_shared_config(team)
  end
end

#remove(team_name, shared_config_name) ⇒ Object



302
303
304
305
306
307
308
309
# File 'lib/sem/cli/teams.rb', line 302

def remove(team_name, shared_config_name)
  team = Sem::API::Team.find!(team_name)
  shared_config = Sem::API::SharedConfig.find!(shared_config_name)

  team.remove_shared_config(shared_config)

  puts "Shared Configuration #{shared_config_name} removed from the team."
end