diff options
author | yuuji.yaginuma <yuuji.yaginuma@gmail.com> | 2018-12-29 18:57:55 +0900 |
---|---|---|
committer | yuuji.yaginuma <yuuji.yaginuma@gmail.com> | 2018-12-29 18:57:55 +0900 |
commit | fb173b66138adf1d6940aca3af76d3c62307441d (patch) | |
tree | 4c2075d68445f103718cfcf34c7c89a603ec4bba /railties/lib/rails/commands | |
parent | a4fe5c5b6606f5b320222069f076c73a2eb3d12e (diff) | |
download | rails-fb173b66138adf1d6940aca3af76d3c62307441d.tar.gz rails-fb173b66138adf1d6940aca3af76d3c62307441d.tar.bz2 rails-fb173b66138adf1d6940aca3af76d3c62307441d.zip |
Do not show suggestion message when not exist suggestion
**before**
```
$ ./bin/rails g g
Could not find generator 'g'. Maybe you meant nil?
Run `rails generate --help` for more options.
```
**after**
```
$ ./bin/rails g g
Could not find generator 'g'.
Run `rails generate --help` for more options.
```
Diffstat (limited to 'railties/lib/rails/commands')
-rw-r--r-- | railties/lib/rails/commands/server/server_command.rb | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/railties/lib/rails/commands/server/server_command.rb b/railties/lib/rails/commands/server/server_command.rb index 70789e0303..6c4cc3cb86 100644 --- a/railties/lib/rails/commands/server/server_command.rb +++ b/railties/lib/rails/commands/server/server_command.rb @@ -302,9 +302,10 @@ module Rails MSG else suggestion = Rails::Command::Spellchecker.suggest(server, from: RACK_SERVERS) + suggestion_msg = "Maybe you meant #{suggestion.inspect}?" if suggestion <<~MSG - Could not find server "#{server}". Maybe you meant #{suggestion.inspect}? + Could not find server "#{server}". #{suggestion_msg} Run `rails server --help` for more options. MSG end |