Class: Team

Inherits:
Object
  • Object
show all
Defined in:
lib/actions/teams.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#teamlistObject

Returns the value of attribute teamlist.



7
8
9
# File 'lib/actions/teams.rb', line 7

def teamlist
  @teamlist
end

Class Method Details

.shell_prompt(config) ⇒ Object



9
10
11
12
13
14
15
# File 'lib/actions/teams.rb', line 9

def self.shell_prompt(config)
  if config['Repo'].nil?
    Rainbow("#{config['User']}> ").aqua << Rainbow("#{config['Org']}> ").magenta << Rainbow("#{config['Team']}> ").color('#eeff41')
  else
    Rainbow("#{config['User']}> ").aqua + Rainbow("#{config['Org']}> ").magenta << Rainbow("#{config['Team']}> ").color('#eeff41') << Rainbow("#{config['Repo']}> ").color(236, 151, 21)
  end
end

Instance Method Details

#build_cd_syntax(type, name) ⇒ Object



17
18
19
20
21
22
23
# File 'lib/actions/teams.rb', line 17

def build_cd_syntax(type, name)
  syntax_map = { 'repo' => "Team.new.cd('repo', #{name}, client, env)" }
  unless syntax_map.key?(type)
    raise Rainbow("cd #{type} currently not supported.").color('#cc0000')
  end
  syntax_map[type]
end

#open_info(config, params = nil, client = nil) ⇒ Object



25
26
27
28
29
30
31
# File 'lib/actions/teams.rb', line 25

def open_info(config, params = nil, client = nil)
  if config['Repo'].nil?
    open_url(config['team_url'].to_s)
  else
    open_url(config['repo_url'].to_s)
  end
end