bin/padrino-gen in padrino-gen-0.2.2 vs bin/padrino-gen in padrino-gen-0.2.5
- old
+ new
@@ -1,20 +1,16 @@
#!/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
+Padrino::Generators::Base.start(ARGV)
+Padrino::Generators.lockup!
-generator_kind = ARGV.delete_at(0).to_s.downcase.to_sym if ARGV[0].present?
-generator_class = generator_mappings[generator_kind]
+generator_kind = ARGV.delete_at(0).to_s.downcase.to_sym if ARGV[0].present?
+generator_class = Padrino::Generators.mappings[generator_kind]
arguments = ARGV.any? ? ARGV : ['-h']
-if generator_class
+if generator_class
generator_class.start(arguments)
else
- puts "Please specify generator to use (#{generator_mappings.keys.join(", ")})"
+ puts "Please specify generator to use (#{Padrino::Generators.mappings.keys.join(", ")})"
end
\ No newline at end of file