Expands the search field on the rails/info/routes page to also search:
* Route name (with or without a _path and _url extension)
* HTTP Verb (eg. GET/POST/PUT etc.)
* Controller#Action
because it's not obvious that the search field is currently only
restricted to the route paths.
This commit improves the error message that is displayed when a user
specifies an unrecognized `bin/rails` command by offering "Did you
mean?" suggestions. The suggestions cover all visible commands, and
supersede any incomplete (Rake-task-only) suggestions that Rake might
display.
__Before (example)__
```console
$ bin/rails credentails:edit
rails aborted!
Don't know how to build task 'credentails:edit' (See the list of available tasks with `rails --tasks`)
(See full trace by running task with --trace)
$ bin/rails --tasks
...
rails cache_digests:dependencies # Lookup first-level dependencies for TEMPLATE (like messages/show or comments/_comment.html)
rails cache_digests:nested_dependencies # Lookup nested dependencies for TEMPLATE (like messages/show or comments/_comment.html)
rails db:create # Creates the database from DATABASE_URL or config/database.yml for the current RAILS_ENV (use ...
rails db:drop # Drops the database from DATABASE_URL or config/database.yml for the current RAILS_ENV (use db...
...
$ bin/rails credentails -h
# no output
$ bin/rails credentials -h
# no output
$ bin/rails versoin
rails aborted!
Don't know how to build task 'versoin' (See the list of available tasks with `rails --tasks`)
Did you mean? db:version
(See full trace by running task with --trace)
```
__After (example)__
```console
$ bin/rails credentails:edit
Unrecognized command "credentails:edit" (Rails::Command::UnrecognizedCommandError)
Did you mean? credentials:edit
$ bin/rails credentails -h
Unrecognized command "credentails" (Rails::Command::UnrecognizedCommandError)
Did you mean? credentials:diff
$ bin/rails credentials -h
Unrecognized command "credentials" (Rails::Command::UnrecognizedCommandError)
Did you mean? credentials:diff
$ bin/rails versoin
Unrecognized command "versoin" (Rails::Command::UnrecognizedCommandError)
Did you mean? version
```
`codespell` works with a small custom dictionary and seems to find perhaps more spelling mistakes than `misspell` which really only fixes commonly misspelled English words.
Not all spell checkers can check all file types and most spell checkers can't find all the errors.
https://github.com/codespell-project/codespellhttps://pypi.org/project/codespell/