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



142
143
144
145
146
147
148
149
# File 'lib/sem/cli/teams.rb', line 142

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



130
131
132
133
134
135
136
137
138
139
# File 'lib/sem/cli/teams.rb', line 130

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



152
153
154
155
156
157
158
159
# File 'lib/sem/cli/teams.rb', line 152

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