| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
| |
Since credentials generator is executed via the credentials command and
does not need to be executed directly, so it is not necessary to show it in
help.
|
|
|
|
| |
This basically reverts 618268b4b9382f4bcf004a945fe2d85c0bd03e32
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
|
| |
".. with __dir__ we can restore order in the Universe." - by @fxn
Related to 5b8738c2df003a96f0e490c43559747618d10f5f
|
|
|
|
|
|
|
|
| |
This fixes the following warning.
```
Expected string default value for '--test-framework'; got false (boolean)
```
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Originally I had set up system testing to have one configuration option
to be set in the test environment. After thinking it over I think a
generated class on app creation would be best. The reason for this is
Capybara has a ton of configuration options that I'm sure some folks
want to use.
Thinking about how we handle screenshots, database transactions, and a
whole bunch of other settings it would be better for users to be able to
turn all of that on and off.
When an app or scaffold is generated a `test/system_test_helper.rb` test
helper will be generated as well. This will contain the class for tests
to inherit from `ActionSystemTestCase` which will inherit from
`ActionSystemTest::Base`. Here is where users can change the test
driver, remove the screenshot helper, and add their additional Capybara
configuration.
|
|
|
|
|
|
|
| |
* Generates system test requirements with new Rails app
* Includes required default gems in Gemfile for Rails app
* Generates a single system test case
* Generates a system test case with scaffold
|
|\
| |
| |
| |
| | |
Conflicts:
railties/lib/rails/generators.rb
|
| |
| |
| |
| | |
[ci skip]
|
| | |
|
| | |
|
|/
|
|
| |
there aren't any instance method defined in this class
|
| |
|
| |
|
|
|
|
| |
Lacks some proper creds to the homies who went the... distance ;)
|
|
|
|
|
|
|
|
| |
Style/SpaceBeforeBlockBraces
Style/SpaceInsideBlockBraces
Style/SpaceInsideHashLiteralBraces
Fix all violations in the repository.
|
| |
|
|
|
|
|
| |
The current code base is not uniform. After some discussion,
we have chosen to go with double quotes by default.
|
|
|
|
|
| |
View files is necessary to send mail, it should be generated even Rails API.
Fixes #23617
|
|
|
|
|
| |
Like the other generator, for also Active Job, I think that there is no need to
display for test generator.
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Calculating -------------------------------------
each_char 924.000 i/100ms
each_codepoint 1.381k i/100ms
-------------------------------------------------
each_char 9.320k (¡Þ 5.1%) i/s - 47.124k
each_codepoint 13.857k (¡Þ 3.6%) i/s - 70.431k
Comparison:
each_codepoint: 13857.4 i/s
each_char: 9319.5 i/s - 1.49x slower
The full report can be found here:
https://gist.github.com/yuki24/a80988f35aceac76f1d5
|
|\
| |
| | |
Improve generator name suggestions a bit.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Previously, the Levenshtein distances to most commands were wrongly
calculated due to a big shortcut. This might be included in the original
code for the performance sake, but I'm not sure that's something we should
take over accuracy in Rails.
Before
'foo' to 'assets' #=> 3
'foo' to 'controller' #=> 3
'foo' to 'generator' #=> 3
'foo' to 'helper' #=> 3
'foo' to 'integration_test' #=> 3
'foo' to 'jbuilder' #=> 3
'foo' to 'job' #=> 2
'foo' to 'mailer' #=> 3
'foo' to 'migration' #=> 3
'foo' to 'model' #=> 3
'foo' to 'resource' #=> 3
'foo' to 'resource_route' #=> 3
'foo' to 'scaffold' #=> 3
'foo' to 'scaffold_controller' #=> 3
'foo' to 'task' #=> 4
'foo' to 'active_record:migration' #=> 3
'foo' to 'active_record:model' #=> 3
'foo' to 'coffee:assets' #=> 3
'foo' to 'css:assets' #=> 3
'foo' to 'css:scaffold' #=> 3
'foo' to 'erb:controller' #=> 3
'foo' to 'erb:mailer' #=> 3
'foo' to 'erb:scaffold' #=> 3
'foo' to 'js:assets' #=> 3
'foo' to 'scss:assets' #=> 3
'foo' to 'scss:scaffold' #=> 3
'foo' to 'test_unit:controller' #=> 3
'foo' to 'test_unit:generator' #=> 3
'foo' to 'test_unit:helper' #=> 3
'foo' to 'test_unit:integration' #=> 3
'foo' to 'test_unit:job' #=> 3
'foo' to 'test_unit:mailer' #=> 3
'foo' to 'test_unit:model' #=> 3
'foo' to 'test_unit:plugin' #=> 3
'foo' to 'test_unit:scaffold' #=> 3
After
'foo' to 'assets' #=> 6
'foo' to 'controller' #=> 8
'foo' to 'generator' #=> 8
'foo' to 'helper' #=> 6
'foo' to 'integration_test' #=> 15
'foo' to 'jbuilder' #=> 8
'foo' to 'job' #=> 2
'foo' to 'mailer' #=> 6
'foo' to 'migration' #=> 8
'foo' to 'model' #=> 4
'foo' to 'resource' #=> 7
'foo' to 'resource_route' #=> 12
'foo' to 'scaffold' #=> 6
'foo' to 'scaffold_controller' #=> 16
'foo' to 'task' #=> 4
'foo' to 'active_record:migration' #=> 21
'foo' to 'active_record:model' #=> 17
'foo' to 'coffee:assets' #=> 12
'foo' to 'css:assets' #=> 10
'foo' to 'css:scaffold' #=> 10
'foo' to 'erb:controller' #=> 12
'foo' to 'erb:mailer' #=> 10
'foo' to 'erb:scaffold' #=> 10
'foo' to 'js:assets' #=> 9
'foo' to 'scss:assets' #=> 11
'foo' to 'scss:scaffold' #=> 11
'foo' to 'test_unit:controller' #=> 18
'foo' to 'test_unit:generator' #=> 18
'foo' to 'test_unit:helper' #=> 16
'foo' to 'test_unit:integration' #=> 20
'foo' to 'test_unit:job' #=> 12
'foo' to 'test_unit:mailer' #=> 16
'foo' to 'test_unit:model' #=> 14
'foo' to 'test_unit:plugin' #=> 16
'foo' to 'test_unit:scaffold' #=> 16
Besides that, the conjunction "or" of the message now appears only between
the last two suggestions.
|
|/
|
|
|
| |
Changes a call to #map and a subsequent call to #flatten to the more idiomatic
version of #flat_map. This commit also removes an unnessecary return statement.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|\ |
|
| | |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Let's say we just ran:
```
$ rails g migrate add_click_to_issue_assignment
```
We will get an error that looks like:
```
Could not find generator migrate.
```
This patch adds all existing migrations to the output to make it easier for a developer to find a valid migration.
```
Could not find generator "migrate". Please select a valid generator:
Rails:
assets
controller
generator
helper
integration_test
mailer
migration
model
resource
scaffold
scaffold_controller
task
```
It would be nice to do some spelling detection and suggest alternatives, but for now this should help.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
schneems/schneems/generator-output-in-error"
This reverts commit 7466d6a9f989a1a8f90899b79b34f1152e440b7c, reversing
changes made to b850c4c540e8f0c15742f67c532f521a4a123655.
This was an accidental merge. A new PR will follow.
/cc @schneems
|
|/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Let's say we just ran:
```
$ rails g migrate add_click_to_issue_assignment
```
We will get an error that looks like:
```
Could not find generator migrate.
```
This patch adds all existing migrations to the output to make it easier for a developer to find a valid migration.
```
Could not find generator "migrate". Please select a valid generator:
Rails:
assets
controller
generator
helper
integration_test
mailer
migration
model
resource
scaffold
scaffold_controller
task
```
It would be nice to do some spelling detection and suggest alternatives, but for now this should help.
|
|
|
|
|
|
|
| |
The generators entry point file is rails/generators so we need to make
sure uers will be able to use the generators when requiring that file.
Fixes #12802
|
|
|
|
|
| |
rails/generators should not load rails/generators/base since the
latter is loading it.
|
|
|
|
|
| |
There are historical reasons that the `plugin` command was `plugin_new`, now those are no longer applicable, we should remove the naming edge case from the project. This PR is based off of comments from #11176
ATP Railties
|
| |
|