run(args = [], runtime_options = {})
public
Run the generator script. Takes an array of unparsed arguments and a hash
of parsed arguments, takes the generator as an option or first remaining
argument, and invokes the requested command.
Show source
def run(args = [], runtime_options = {})
begin
parse!(args.dup, runtime_options)
rescue OptionParser::InvalidOption => e
end
unless options[:generator]
usage if args.empty?
options[:generator] ||= args.shift
end
Rails::Generator::Base.instance(options[:generator], args, options).command(options[:command]).invoke!
rescue => e
puts e
puts " #{e.backtrace.join("\n ")}\n" if options[:backtrace]
raise SystemExit
end