Class: Mddb::Generators::Run

Inherits:
Object
  • Object
show all
Defined in:
lib/mddb/generators.rb

Class Method Summary collapse

Class Method Details

.startObject



11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
# File 'lib/mddb/generators.rb', line 11

def self.start
  if ARGV.empty?
    puts "try one of the following"
    Mddb::Generators.list.each do |g|
      puts "  #{g} <name>"
    end
  elsif Mddb::Generators.list.include? ARGV.first
    gen = ARGV.first
    ARGV.shift
    if ARGV.empty?
      puts "supply a name"
    else
      eval("Mddb::Generators::" + gen.capitalize + ".start")
    end
  end
    
end