This project is archived and is in readonly mode.
[PATCH] Rails rake ignoring bundled frozen gem tasks
-
Nathaniel Bibler
- Title changed from [Patch] Rails rake ignoring bundled frozen gem tasks to [PATCH] Rails rake ignoring bundled frozen gem tasks
Added custom Rake task loading test to Railties specifically for this patch. Patch file updated.
-
Nathaniel Bibler
Tests were added at the request of Manfred Stienstra (manfred-s) in #rails-contrib.
A custom
task_test.rbfile was added since the tests require loadingrakeand friends. I didn't want to dirty any of the existing non-rake-specific test files in railties.At some point, the
task_test.rbshould probably be extended to ensure that bothvendor/plugins/**/tasks/**/*.rakeandlib/tasks/*.rakeare being properly loaded. But that didn't seem appropriate for this specific patch. -
Matt Jones
This is still under discussion on ticket #59 - the issue is more complicated than just a line of code. For instance, your patch means that gems in vendor/gems behave differently than gems in the system repository.
-
Nathaniel Bibler
Hey Matt. You are correct, Tyler Hunt and I were talking about that a few days ago when I had him read through it.
I actually created something that could work for installed - but not frozen - gems. However, it required loading the Rails environment for every Rake task, which certainly isn't a good thing to do (it uses
Rails.configurationto pull the dependent gems and then reading the gem specs for the locally-installed directory and scanning for a tasks subdirectory).Honestly, I don't see it as a down side to only support frozen gems. Doing so does not take away current functionality, but rather enhances it. Certainly it's not a 100% solution, but on a effort-to-reward ratio, I think it significantly outweighs any solutions I could come up with for supporting it all.
-
Matt Jones
As previously noted, the issue is that this behavior is new. Gems that don't expect to have their rake tasks dropped into the app's namespace may have picked names for their tasks that break other things ('test', for instance...)
The near-term workaround is probably to do a require on the tasks from the gem - check out Ryan Bates's comment on #59 for more detail.
-
Rohit Arondekar
- State changed from new to invalid
- Importance changed from to
