Lighthouse has a new layout. Prefer the old one? Return to the old layout, and switch back any time from the link at the top of each page.

This project is archived and is in readonly mode.

script generate does not find generators in symlinked plugins

#449

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.

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

State: resolved
Milestone: none
Assigned to: nobody
Importance: none

Activity

  1. phedders
    phedders
    • Title changed from script generator does not find generators in symlinked plugins to script generate does not find generators in symlinked plugins

    June 18th, 2008 @ 10:08 PM

  2. phedders
    phedders

    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

    June 20th, 2008 @ 04:00 PM

  3. Daniel Guettler
    Daniel Guettler

    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

    June 23rd, 2008 @ 04:16 PM

  4. Daniel Guettler
    Daniel Guettler

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

    June 23rd, 2008 @ 04:18 PM

  5. Repository
    Repository
    • State changed from new to resolved
    • Tag set to 2.1, 2.1.0, generate, patch, plugins

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

    Signed-off-by: Pratik Naik

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

    July 12th, 2008 @ 05:59 PM

  6. Repository
    Repository

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

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

    August 25th, 2008 @ 09:27 AM