rails/rails — pull request #7891 by schneems (2012-10-09 21:26:43+00:00)
Title: Prompt to run rake when accidentally typed rails

Developers from all levels will accidentally run rake tasks using the `rails` keyword when they meant to use `rake`. Often times beginners struggle with the difference between the tools. The most common example would be `$ rails db:migrate`

Rather than telling the developer simply that they did not use a valid rails command, we can see if it was a valid rake command first. If it is a valid rake command we can auto execute it giving the user a period of time to cancel if that isn't what they intended.

Here is what `rake db:migrate` would look like if you cancel the command:

```sh
$ rails db:migrate
Assuming you meant: $ rake db:migrate
press any key to cancel in 3 seconds
>
command terminated ...
```

Here is what it looks like if you don't cancel the command:

```sh
$ rails db:migrate
Assuming you meant: $ rake db:migrate
press any key to cancel in 3 seconds
>
Running: $ rake db:migrate
== Foo: migrating ============================================================
== Foo: migrated (0.0000s) ===================================================
```