This project is archived and is in readonly mode.
TemplateRunner adds gems to environment file in reverse of written order
-
Yehuda Katz (wycats)
- State changed from new to verified
Templates are going to be reworked in Rails 3 by José Valim (as part of his GSoC project). Pratik, do you think we should fix this on the 2.3 branch?
-
Yehuda Katz (wycats)
- State changed from open to hold
We looked into this a bit. The problem is that Rails inserts all new text at the top of the environment, using a regex sentinel that looks for the initializer start. The solution is non-trivial, but a patch would be welcome :)
-
CS Merritt (csmosx)
Here's a patch... or two.
template_gem_order_fix just fixes the gem ordering problem.
template_env_order_fix applies both the gem fix and the same fix to route, which had the same ordering problem and used the same function (gsub_file) which I replaced (with regex_file_splice).
Thanks =)
