Optimize indentation for generator actions #30166
Conversation
Thanks for the pull request, and welcome! The Rails team is excited to review your changes, and you should hear from @pixeltrix (or someone else) soon. If any changes to this PR are deemed necessary, please add them as extra commits. This ensures that the reviewer can see what has changed since they last reviewed the code. Due to the way GitHub handles out-of-date commits, this should also make it reasonably obvious what issues have or haven't been addressed. Large or tricky changes may require several passes of review and changes. This repository is being automatically checked for code quality issues using Code Climate. You can see results for this analysis in the PR status below. Newly introduced issues should be fixed before a Pull Request is considered ready to review. Please see the contribution instructions for more information. |
8bf0967
…ment Optimize indentation for generator actions
In rails#1445 I introduced the method `#optimize_indentation`, but this was added in Rails 5.2 (rails/rails#30166) and Webpacker should support Rails 4+. In order to have the same benefit, I'm replacing the calls to the method `#optimize_indentation` with `String#indent`, which is what the original method uses.
In rails#1445 I introduced the method `#optimize_indentation`, but this was added in Rails 5.2 (rails/rails#30166) and Webpacker should support Rails 4+. In order to have the same benefit, I'm replacing the calls to the method `#optimize_indentation` with the method it uses from behind: `String#indent`
Summary
I've found that indentations are broken on
environment
method that is generator's one of actions.Example template
Command
$ bin/rails app:template LOCATION=./template.rb
Before
It seems that it's not supported to be used on multiple lines.
After
Other Information
This is my use case.