1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00
Commit graph

12 commits

Author SHA1 Message Date
Petrik
d6612d5238 Remove Command::Spellchecker and use DidYouMean for suggestions
Instead of generating our own "Maybe you meant ..." message, when a
generator or a server isn't found, use DidYouMean::Correctable.

This commit adds a generic CorrectableError in the Command namespace
that could be used for corrections for other commands.

By using DidYouMean we can delete the Command::Spellchecker.

Co-authored-by: Ryuta Kamizono <kamipo@gmail.com>
2021-06-04 09:20:43 +02:00
Alex Ghiculescu
34ff6a0a4a Display a help message if rails new is called without a path
Fixes https://github.com/rails/rails/issues/42196

Now, `rails new` will display the same error message that `rails` and `rails help new` does.

To test:

- Pull this branch
- Uninstall your local rails copy using `gem uninstall rails`
- Move into the root directory where you pulled down the rails code, then install: `rake install`
- In another directory run `rails new`
2021-05-14 10:21:26 -05:00
Jonathan Hefner
ddcfde2226 Populate ARGV with Rails::Command.invoke args
Follow-up to #38495.

Similar to #40994, but for all Rails commands.  Programmatic and CLI
invocations of Rails commands will still behave identically, and `ARGV`
will still be isolated between invocations.

Reverts #40994.
2021-04-03 10:12:52 -05:00
Jonathan Hefner
8ec7a2b7aa Isolate ARGV in Rails::Command.invoke
Follow-up to #38463.

By isolating ARGV, we guard against commands inadvertently depending on
prior ARGV contents.  Any such command will now behave consistently when
run via `Rails::Command.invoke`, whether coming from the Rails CLI or
from library code.  Likewise, any ARGV mutations done by a command will
not affect code that executes after `Rails::Command.invoke`.
2020-02-18 15:02:56 -06:00
Gannon McGibbon
a670654882 Fix deeply nested namespace command printing 2019-01-24 12:28:43 -05:00
Genadi Samokovarov
cb25f2c989 Use did_you_mean spell checker for option suggestions
Now that we require Ruby over `2.3`, we can replace the current
suggestion methods we have with tooling from the `did_you_mean` gem.

There is a small user visible change and this is that we now offer a
single suggestion for misspelled options. We are suggesting fixes during
generator invocation and during a mistyped rails server rack handler. In
both cases, if we don't make a proper prediction on the first match, we
won't do so in the second or third one, so in my mind, this is okay.
2018-03-23 11:36:03 +02:00
Genadi Samokovarov
a951729f45 Extract Rails::Command::Spellchecker 2018-03-04 17:50:37 +02:00
Pat Allan
acea68de02 Adding frozen_string_literal pragma to Railties. 2017-08-14 19:08:09 +02:00
yuuji.yaginuma
af5368eeff Add rails secrets:show command
When secrets confirmed with the `secrets:edit` command, `secrets.yml.enc`
will change without updating the secrets.

Therefore, even if only want to check secrets, the difference will come
out. This is a little inconvenient.

In order to solve this problem, added the `secrets:show` command.
If just want to check secrets, no difference will occur use this command.
2017-07-07 07:22:01 +09:00
Matthew Draper
87b3e226d6 Revert "Merge pull request #29540 from kirs/rubocop-frozen-string"
This reverts commit 3420a14590, reversing
changes made to afb66a5a59.
2017-07-02 02:15:17 +09:30
Kir Shatrov
cfade1ec7e Enforce frozen string in Rubocop 2017-07-01 02:11:03 +03:00
yuuji.yaginuma
54ee15a203 Show correct commands in help
Currently rails' help shows only namespace. However, the secrets command
needs to specify command. Therefore, I fixed the command to display in help.
2017-03-03 08:18:51 +09:00