#449 √ resolved
phedders

script generate does not find generators in symlinked plugins

Reported by phedders | June 18th, 2008 @ 10:05 PM

If I have a plugin symlinked - ie vendor/plugins/ is a symlink, then script/generate does not find the generators.

If vendor/plugins is a link... no problem.

No idea where to start to fix this bug, sorry.

Comments and changes to this ticket

  • phedders

    phedders June 18th, 2008 @ 10:08 PM

    • → Title changed from “script generator does not find generators in symlinked plugins” to “script generate does not find generators in symlinked plugins”
  • phedders

    phedders June 20th, 2008 @ 04:00 PM

    Just in case Tom forgets... he's fixed this bug though a hack in the hobo plugin, but it really should be fixed upstream. His fix is in:

    git://github.com/tablatom/hobo

    commit 5d04b0b4e4413f9c2d3b352f34463022ae8be1d0

    That will not apply cleanly to rails since it is in the hobo plugin, but will show the logic of the fix.

    Oh heck - here it is:

    +# 'orrible 'ack so that generators are found in symlinked plugins

    +if caller.grep %r(script/generate:\d+$)

    • require "rails_generator"
    • Rails.configuration.plugin_paths.each do |path|
    • relative_path = Pathname.new(File.expand_path(path)).relative_path_from(Pathname.new(::RAILS_ROOT))
    • sources = Rails::Generator::Base.sources
    • sources << Rails::Generator::PathSource.new(:"plugins (#{relative_path})", "#{path}/*/**/{,rails_}generators")
    • end

    +end

    --

    Cheers

    Paul

  • Daniel Guettler

    Daniel Guettler June 23rd, 2008 @ 04:16 PM

    This was originally fixed in commit aa7859c9 see "here": http://github.com/rails/rails/co.... Attached is a patch which brings this change back in the rails_generator/lookup.rb file

  • Daniel Guettler

    Daniel Guettler June 23rd, 2008 @ 04:18 PM

    here the patch again, can't see it from the first commit...

  • Repository

    Repository July 12th, 2008 @ 05:59 PM

    • → Tag changed from “” to “2.1 2.1.0 generate patch plugins”
    • → State changed from “new” to “resolved”

    (from [f90eb81c65d5841b591caf0f5e39ef774d02d06e]) Ensure script/generate finds generators from symlinked plugins. [#449 state:resolved]

    Signed-off-by: Pratik Naik

    http://github.com/rails/rails/co...

  • Repository

    Repository August 25th, 2008 @ 09:27 AM

    (from [84ceff6921a0619de049301a1b8600b51a7e56f8]) Ensure script/generate finds generators from symlinked plugins. [#449 state:resolved]

    Signed-off-by: Pratik Naik pratiknaik@gmail.com http://github.com/rails/rails/co...

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"..

Shared Ticket Bins