Class: Merb::ApplicationGenerator

Inherits:
Object
  • Object
show all
Defined in:
lib/merb-gen.rb

Class Method Summary collapse

Class Method Details

.run(path, argv, generator, command) ⇒ Object



6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
# File 'lib/merb-gen.rb', line 6

def self.run(path, argv, generator, command)
  if command == "destroy"
    puts "destroying app"
    FileUtils.rm_rf(File.expand_path(path))
    puts "done"
    exit
  end
  
  source = RubiGen::PathSource.new(:application, 
    File.join(File.dirname(__FILE__), "..", "app_generators"))
  RubiGen::Base.reset_sources
  RubiGen::Base.append_sources source
  puts RubiGen::Scripts.const_get(command.capitalize).inspect
  RubiGen::Scripts.const_get(command.capitalize).new.run([File.expand_path(path), *argv], :generator => generator, :backtrace => true)
end