The first thing I do after generating a Rails app is remove the default code comments. I was having trouble finding a script to do this automatically, so I decided to make this. It’s super hacky and not recommended since it removes them after they’ve been added, but it gets the job done for now.
It would be cool to allow the user to skip generating the comments by adding a “–skip-comments” flag and by wrapping each comment in the template files:
<% unless skip_comments -%>
comment
<% end -%>
``
But I can see how maintaining this could get out of hand, since each comment in a template would require this logic. An alternative would be using a similar approach to my method and removing them after they’ve been created, but this might cause issues in future Ruby versions and template changes.
You’ve probably already thought about this, but this would save me a lot of time so I want to make sure.
Thanks!
Matias