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



156
157
158
159
160
161
162
163
# File 'lib/sem/cli/teams.rb', line 156

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



144
145
146
147
148
149
150
151
152
153
# File 'lib/sem/cli/teams.rb', line 144

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



166
167
168
169
170
171
172
173
# File 'lib/sem/cli/teams.rb', line 166

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