diff options
author | schneems <richard.schneeman@gmail.com> | 2014-06-03 18:22:45 -0500 |
---|---|---|
committer | schneems <richard.schneeman@gmail.com> | 2014-06-04 16:28:43 -0500 |
commit | 72f45ba2922771e744d91334b8680b9b51784eec (patch) | |
tree | 327247cc8f2868550e02d036a4d822e91d613a4f /guides/source/kindle | |
parent | 3036c4031ab0ce2632d6ac1479ab27cdc4bb4941 (diff) | |
download | rails-72f45ba2922771e744d91334b8680b9b51784eec.tar.gz rails-72f45ba2922771e744d91334b8680b9b51784eec.tar.bz2 rails-72f45ba2922771e744d91334b8680b9b51784eec.zip |
Emit suggested generator names when not found
When someone types in a generator command it currently outputs all generators. Instead we can attempt to find a subtle mis-spelling by running all generator names through a levenshtein_distance algorithm provided by rubygems.
So now a failure looks like this:
```ruby
$ rails generate migratioooons
Could not find generator 'migratioooons'. Maybe you meant 'migration' or 'integration_test' or 'generator'
Run `rails generate --help` for more options.
```
If the suggestions are bad we leave the user with the hint to run `rails generate --help` to see all commands.
Diffstat (limited to 'guides/source/kindle')
0 files changed, 0 insertions, 0 deletions