Class: Sem::Views::Projects

Inherits:
Base
  • Object
show all
Defined in:
lib/sem/views/projects.rb

Class Method Summary collapse

Methods inherited from Base

org_names_not_matching, print_table

Class Method Details

.attach_first_secret(project) ⇒ Object



29
30
31
32
33
34
35
36
# File 'lib/sem/views/projects.rb', line 29

def self.attach_first_secret(project)
  puts "You don't have any secrets on this project."
  puts ""
  puts "Add your first secret:"
  puts ""
  puts "  sem projects:secrets:add #{project.full_name} SECRETS_NAME"
  puts ""
end

.info(project) ⇒ Object



20
21
22
23
24
25
26
27
# File 'lib/sem/views/projects.rb', line 20

def self.info(project)
  print_table [
    ["ID", project.id],
    ["Name", project.full_name],
    ["Created", project.created_at],
    ["Updated", project.updated_at]
  ]
end

.list(projects) ⇒ Object



10
11
12
13
14
15
16
17
18
# File 'lib/sem/views/projects.rb', line 10

def self.list(projects)
  header = ["ID", "NAME"]

  body = projects.map do |project|
    [project.id, project.full_name]
  end

  print_table([header, *body])
end

.setup_first_projectObject



3
4
5
6
7
8
# File 'lib/sem/views/projects.rb', line 3

def self.setup_first_project
  puts "You don't have any project configured on Semaphore."
  puts ""
  puts "Add your first project: https://semaphoreci.com/new"
  puts ""
end