This project is archived and is in readonly mode.

#441 ✓ invalid
Brian Landau

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"

See: http://github.com/brianjlandau/r...

Comments and changes to this ticket

  • Jacek Becela

    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?

  • Clinton R. Nixon

    Clinton R. Nixon June 17th, 2008 @ 10:24 PM

    +1 - I could really use this.

  • Brian Landau

    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

    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

    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

    Jacek Becela June 18th, 2008 @ 06:44 AM

    Brian: My bad, didn't know it's already supported in classic plugins.

    +1

  • Patrick Reagan

    Patrick Reagan July 2nd, 2008 @ 01:55 PM

    • Tag set 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

    Pratik December 20th, 2008 @ 07:29 PM

    • Tag changed from generators, patch, railties, rake, tested to generators, patch, railties, rake, tested, verified
    • Assigned user set to “Pratik”

    Waiting for Matt Jones' review.

  • Matt Jones

    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

    Pratik December 20th, 2008 @ 10:59 PM

    • State changed from “new” to “invalid”

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile »

Tickets have moved to Github

The new ticket tracker is available at https://github.com/rails/rails/issues

Shared Ticket Bins

Attachments

Referenced by

Pages