Class: Zedkit::CLI::Projects

Inherits:
Bottom
  • Object
show all
Defined in:
lib/zedkit/cli/projects.rb

Class Method Summary collapse

Methods inherited from Bottom

method_missing

Class Method Details

.create(opts = {}) ⇒ Object



36
37
38
# File 'lib/zedkit/cli/projects.rb', line 36

def create(opts = {})
  puts "\n" << Zedkit::CLI.ee(opts[:locale], :general, :not_done) << "\n\n"
end

.delete(opts = {}) ⇒ Object



44
45
46
# File 'lib/zedkit/cli/projects.rb', line 44

def delete(opts = {})
  puts "\n" << Zedkit::CLI.ee(opts[:locale], :general, :not_done) << "\n\n"
end

.list(opts = {}) ⇒ Object



22
23
24
25
26
27
28
29
30
# File 'lib/zedkit/cli/projects.rb', line 22

def list(opts = {})
  rs  = dashes(122) << "| #{'Zedkit Projects'.ljust(118)} |\n" << dashes(122) \
     << "| #{'UUID'.ljust(32)} | #{'Name'.ljust(32)} | #{'Location'.ljust(48)} |\n" << dashes(122)
  Zedkit::Users::Projects.get(:user_key => opts[:user_key]) do |up|
    pp  = Zedkit::Project.new.set_with_hash up['project']
    rs << "| #{pp.uuid.ljust(32)} | #{pp.name.ljust(32)} | #{pp.location.ljust(48)} |\n"
  end
  puts rs << dashes(122)
end

.show(opts = {}) ⇒ Object



32
33
34
# File 'lib/zedkit/cli/projects.rb', line 32

def show(opts = {})
  puts Zedkit::Project.new(:user_key => opts[:user_key], :locale => opts[:locale], :uuid => opts[:argv][0])
end

.update(opts = {}) ⇒ Object



40
41
42
# File 'lib/zedkit/cli/projects.rb', line 40

def update(opts = {})
  puts "\n" << Zedkit::CLI.ee(opts[:locale], :general, :not_done) << "\n\n"
end