#!/usr/bin/env ruby %w[rubygems thor].each { |gem| require gem } require File.dirname(__FILE__) + "/../lib/padrino-gen" generator_mappings = SupportLite::OrderedHash.new generator_mappings[:app] = Padrino::Generators::Skeleton generator_mappings[:model] = Padrino::Generators::Model generator_mappings[:migration] = Padrino::Generators::Migration generator_mappings[:controller] = Padrino::Generators::Controller generator_mappings[:mailer] = Padrino::Generators::Mailer generator_kind = ARGV.delete_at(0).to_s.downcase.to_sym if ARGV[0].present? generator_class = generator_mappings[generator_kind] arguments = ARGV.any? ? ARGV : ['-h'] if generator_class generator_class.start(arguments) else puts "Please specify generator to use (#{generator_mappings.keys.join(", ")})" end