This method is deprecated or moved on the latest stable version.
The last existing version (v2.3.8) is shown here.
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.
# File railties/lib/rails_generator/scripts.rb, line 17
def run(args = [], runtime_options = {})
begin
parse!(args.dup, runtime_options)
rescue OptionParser::InvalidOption => e
# Don't cry, script. Generators want what you think is invalid.
end
# Generator name is the only required option.
unless options[:generator]
usage if args.empty?
options[:generator] ||= args.shift
end
# Look up generator instance and invoke command on it.
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