Class: Cerberus::ListCommand

Inherits:
Object
  • Object
show all
Defined in:
lib/cerberus/manager.rb

Instance Method Summary collapse

Constructor Details

#initialize(cli_options = {}) ⇒ ListCommand

Returns a new instance of ListCommand.



214
215
# File 'lib/cerberus/manager.rb', line 214

def initialize(cli_options = {})                                                                             
end

Instance Method Details

#runObject



217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
# File 'lib/cerberus/manager.rb', line 217

def run
  projects = Dir["#{HOME}/config/*.yml"]
  if projects.empty?
    puts "There are no active projects" 
  else
    puts "List of active projects:"
    
    projects.sort.each do |fn|
      fn =~ %r{#{HOME}/config/(.*).yml}
      
      puts "  * #{$1}"
    end
    
    puts "\nType 'cerberus build PROJECT_NAME' to build any of these projects"
  end
end