This project is archived and is in readonly mode.
A simple way to copy the default generator templates is needed
Reported by Rodrigo Urubatan | May 11th, 2010 @ 02:04 AM | in 3.0.2
A great feature was added in Rails 3, the hability to easily
personalize the output of the generators for each application, this
can improve the productivity in many cases.
I missed this functionality for a long time, since I worked with
Grails for some time, and now I think only a small piece of the
grails functionality is still missing.
in Grails there is a task called "install-templates" that copies
the default templates to the personalization folder.
I created a rake task and published it in gist to do this http://gist.github.com/396453
Im attaching a patch with this template too.<br/> The
rake task name I created is templates:copy
Comments and changes to this ticket
-
Rodrigo Urubatan May 11th, 2010 @ 02:07 AM
- no changes were found...
-
Rodrigo Urubatan May 11th, 2010 @ 02:13 AM
- Tag changed from generator, personalization, templates to generator, patch, personalization, templates
-
José Valim May 11th, 2010 @ 02:33 AM
- Milestone cleared.
- Tag changed from generator, patch, personalization, templates to bugmash, generator, patch, personalization, templates
- State changed from new to open
- Assigned user set to José Valim
The idea seems good, but the patch needs to be improved. No need to load rubygems since you are already inside the railties gem (just use FILE). You should also use FileUtils.cp_r to simplify the code!
-
Rodrigo Urubatan May 11th, 2010 @ 04:36 PM
DRYied up the code a little, removed the rubygems reference, now using FILE to lookup the directory, and using cp_r to simplify file copy.
Any other suggestions are welcome. -
Jeroen van Dijk May 14th, 2010 @ 11:00 PM
I like this idea.
When I apply this patch it gives me errors for the mailer and I think the code can be cleaned up a bit. I also think this Rake task should be under the rails namespace.
So I refactored the patch and I have tested it manually on a new application.
It seems that the erb templates are not used by the "rails g" command, is that correct? Maybe we can remove those from the code? and make it more simple?
-
José Valim May 15th, 2010 @ 08:33 AM
erb templates are used by rails g command.
I would like to credit Urubatan in this patch as well.
Jeroen, is it ok if I change the author to "Jeroen van Dijk + Rodrigo Urubatan" so you both get the credit? -
Repository May 15th, 2010 @ 02:02 PM
- State changed from open to resolved
(from [80fc6536bda191731e3963f1539c84a7b0c4e764]) Added Rake task rails:templates:copy to copy templates for customization [#4574 state:resolved]
Signed-off-by: José Valim jose.valim@gmail.com
http://github.com/rails/rails/commit/80fc6536bda191731e3963f1539c84... -
Jeremy Kemper October 15th, 2010 @ 11:01 PM
- Milestone set to 3.0.2
- Importance changed from to Low
Create your profile
Help contribute to this project by taking a few moments to create your personal profile. Create your profile »
<h2 style="font-size: 14px">Tickets have moved to Github</h2>
The new ticket tracker is available at <a href="https://github.com/rails/rails/issues">https://github.com/rails/rails/issues</a>
People watching this ticket
Attachments
Referenced by
- 4574 A simple way to copy the default generator templates is needed (from [80fc6536bda191731e3963f1539c84a7b0c4e764]) Added R...