mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
52f2f9810e
Allows any Rake task to be run through `bin/rails` such as `bin/rails db:migrate`, `bin/rails notes` etc. The Rake tasks are appended to Rails' help output, and blend in as standard commands.
19 lines
346 B
Ruby
19 lines
346 B
Ruby
ARGV << '--help' if ARGV.empty?
|
|
|
|
aliases = {
|
|
"g" => "generate",
|
|
"d" => "destroy",
|
|
"c" => "console",
|
|
"s" => "server",
|
|
"db" => "dbconsole",
|
|
"r" => "runner",
|
|
"t" => "test"
|
|
}
|
|
|
|
command = ARGV.shift
|
|
command = aliases[command] || command
|
|
|
|
require 'rails/command'
|
|
require 'rails/commands/dev_cache'
|
|
|
|
Rails::Command.run(command, ARGV)
|