Class: Sem::CLI::Projects

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

Defined Under Namespace

Classes: EnvVars, Files, SharedConfigs

Instance Method Summary collapse

Instance Method Details

#create(project_name) ⇒ Object



62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
# File 'lib/sem/cli/projects.rb', line 62

def create(project_name)
  url = Sem::Helpers::GitUrl.new(options[:url])

  abort "Git URL #{options[:url]} is invalid." unless url.valid?

  args = {
    :repo_provider => url.repo_provider,
    :repo_owner => url.repo_owner,
    :repo_name => url.repo_name
  }

  project = Sem::API::Project.create!(project_name, args)

  Sem::Views::Projects.info(project)
end

#info(project_name) ⇒ Object



33
34
35
36
37
# File 'lib/sem/cli/projects.rb', line 33

def info(project_name)
  project = Sem::API::Project.find!(project_name)

  Sem::Views::Projects.info(project)
end

#listObject



13
14
15
16
17
18
19
20
21
# File 'lib/sem/cli/projects.rb', line 13

def list
  projects = Sem::API::Project.all

  if !projects.empty?
    Sem::Views::Projects.list(projects)
  else
    Sem::Views::Projects.setup_first_project
  end
end