This project is archived and is in readonly mode.
Rail3 will not load generators that are located in gems that are loaded using bundler
Reported by joshsmoore (at gmail) | December 21st, 2009 @ 06:13 AM
When gems are managed through bundler the Gem module will not respond to the loaded_specs method. This makes it impossible to load generators from the included gems. I patched the generators.rb so that if Gem does not respond to loaded_specs and if Gem.path is not nil to look for generators in the Gem.path directory. I have attached a patch and it would be great if I could get some feedback on it (this is my first patch I have submitted to rails).
Comments and changes to this ticket
-
José Valim January 3rd, 2010 @ 12:22 AM
- State changed from new to open
- Assigned user set to José Valim
-
Rizwan Reza January 3rd, 2010 @ 03:58 PM
- Tag changed from generators, patch, rails3 to generators, patch, rails3, review
+1 Applies cleanly on master. All tests in railties also pass.
By the way, I don't know if it really needs tests, but the patch above doesn't include one.
-
José Valim January 3rd, 2010 @ 04:01 PM
Thanks guys. I just have to check with Yehuda if they plan to support Gem.loaded_specs or I will have to use Gem.path as Josh proposed.
-
José Valim January 20th, 2010 @ 01:58 PM
- State changed from open to resolved
Just have generators in your load path and it will work. If you want to invoke to "script/generate foo", have "generators/foo_generator" in your load path and it will be picked.
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>