1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00
rails--rails/railties/lib/rails/commands.rb
Dharam Gollapudi 52f2f9810e Implement Rake proxy for Rails' command line interface.
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.
2015-12-13 20:59:41 +01:00

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)