Class: Slugforge::Commands::Project

Inherits:
SubCommand show all
Defined in:
lib/slugforge/commands/project.rb

Instance Method Summary collapse

Methods inherited from SubCommand

banner

Methods inherited from Slugforge::Command

#initialize, start

Methods included from Helper

included

Constructor Details

This class inherits a constructor from Slugforge::Command

Instance Method Details

#listObject



7
8
9
10
11
12
13
14
15
16
17
18
# File 'lib/slugforge/commands/project.rb', line 7

def list
  logger.say "Available projects:"

  tag_manager.projects.map do |project|
    out = [set_color(project, :green)]
    pc = tag_manager.slug_for_tag(project, 'production-current')
    out << "(production-current: #{set_color(pc, :yellow)})" unless pc.nil?
    out
  end.sort.each do |o|
    logger.say "  #{o * ' '}"
  end
end