Add more support for gems frozen in the vendor directory
Reported by Brian Landau | June 17th, 2008 @ 10:09 PM
In this patch I add support for vendorized gems adding rake tasks and generators in the "rails" sub-directory of the gem. i.e. "vendor/gems/my_gem-1.3.1/rails/generators" and "vendor/gems/my_gem-1.3.1/rails/tasks"
Comments and changes to this ticket
-
Jacek Becela June 17th, 2008 @ 10:13 PM
Should we aim for the same in classic plugins to ensure consistency, so one can have a single code base for a plugin which can be distributed as a classic one or gemplugin?
-

-
Brian Landau June 17th, 2008 @ 10:29 PM
Jacek: I'm not sure, my initial response would be I would feel like no. Plugin's are inherently only for rails, and thus the name-spaced subdirectory is unneeded. With gems though this is not the case, a gem could provide some functionality that isn't rails specific and offer some functionality that is rails specific.
The point of name-spacing in this case is to make it easy for developers to take a set of support files and make them rails specific and ensure they are only accessible in the scope of a rails project.
-
Jacek Becela June 17th, 2008 @ 10:52 PM
Brian: Take a look at this patch (which was submitted), it's a step towards full consistency between classic plugins and gemplugins:
http://rails.lighthouseapp.com/p...
Before that you would have to have rails/init.rb AND init.rb in main dir of your plugin to have the possibility to distribute it both as gemplugin and classic plugin.
The biggest thing about this "consistency effort" is that it makes easier to migrate plugins to gemplugins and in the result completely abandon classic plugins.
-
Brian Landau June 17th, 2008 @ 11:29 PM
Jacek: If I get what you're saying a plugin with generators and tasks in the rails/generators and rails/tasks subdirectories respectively would also be loaded in the projects scope.
After a quick test this is already supported with the current glob rules in 2.1
So yes I'm in support of continuing to allow plugins to put generators and tasks in a rails subdirectory.
-
Jacek Becela June 18th, 2008 @ 06:44 AM
Brian: My bad, didn't know it's already supported in classic plugins.
+1
-
Patrick Reagan July 2nd, 2008 @ 01:55 PM
- → Tag changed from to generators patch railties rake tested
+1 - I have something that I have as a plugin that I would rather have as a gem (to auto-satisfy dependencies) so I could definitely use this.
-
Pratik December 20th, 2008 @ 07:29 PM
- → Tag changed from generators patch railties rake tested to generators patch railties rake tested verified
- → Assigned user changed from to Pratik
Waiting for Matt Jones' review.
-

Matt Jones December 20th, 2008 @ 09:23 PM
Generators are handled correctly by the current code, and there's an ongoing debate about Rake tasks - see #59 for details. This can probably be closed, and discussion moved to #59.
Note that the patch given here will cause odd results if more than one version of a gem is frozen in vendor/gems, as it loads rake tasks from both. No idea what that might do...
-
Pratik December 20th, 2008 @ 10:59 PM
- → State changed from new to invalid
Please Login or create a free account to add a new comment.
You can update this ticket by sending an email to from your email client. (help)
Create your profile
Help contribute to this project by taking a few moments to create your personal profile. Create your profile »
Source available from github
Repository is at http://github.com/rails/rails
Check out the development master (Edge Rails):
git clone git://github.com/rails/rails.git
Creating or reviewing a patch
See the contributor guide.
Creating a feature request
Please don't. If you want a new feature in Rails, you'll have to pull up your sleeves and get busy yourself. Or convince someone else to do it. See the contributor guide on how to get going. But posting them here is just going to lead to ticket root.
Creating a bug report
When creating a bug report, be sure to include as much relevant information as possible. Post the code sample that causes the problem. Preferably, alter the unit tests and show through either changed or added tests how the expected behavior is not occuring.
Security vulnerabilities should be reported via an email to security@rubyonrails.org, do not use trac for reporting security vulnerabilities. All content in trac is publicly available as soon as it is posted.
Then don't get your hopes up. Unless you have a "Code Red, Mission Critical, The World is Coming to an End" kinda bug, you're creating this ticket in the hope that others with the same problem will be able to collaborate with you on solving it. Do not expect that the ticket automatically will see any activity or that others will jump to fix it. Creating a ticket like this is mostly to help yourself start on the path of fixing the problem and for others to sign on to with a "I'm having this problem too"..
