diff options
author | David Heinemeier Hansson <david@loudthinking.com> | 2008-03-13 02:47:26 +0000 |
---|---|---|
committer | David Heinemeier Hansson <david@loudthinking.com> | 2008-03-13 02:47:26 +0000 |
commit | dd665ff9679514e354336bb183a9b40ad17145fb (patch) | |
tree | 4ce55421bea5fdae8d7cbed85a33fd1434dd12a8 /railties/lib/rails_generator/lookup.rb | |
parent | e915379a102b5cecf0a9ffb26236dff3738d4dd7 (diff) | |
download | rails-dd665ff9679514e354336bb183a9b40ad17145fb.tar.gz rails-dd665ff9679514e354336bb183a9b40ad17145fb.tar.bz2 rails-dd665ff9679514e354336bb183a9b40ad17145fb.zip |
Fixed that script/generate would not look for plugin generators in plugin_paths (closes #11000) [glv]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@9017 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'railties/lib/rails_generator/lookup.rb')
-rw-r--r-- | railties/lib/rails_generator/lookup.rb | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/railties/lib/rails_generator/lookup.rb b/railties/lib/rails_generator/lookup.rb index d88a1948a4..1f28c39d55 100644 --- a/railties/lib/rails_generator/lookup.rb +++ b/railties/lib/rails_generator/lookup.rb @@ -1,3 +1,5 @@ +require 'pathname' + require File.dirname(__FILE__) + '/spec' class Object @@ -104,8 +106,10 @@ module Rails if defined? ::RAILS_ROOT sources << PathSource.new(:lib, "#{::RAILS_ROOT}/lib/generators") sources << PathSource.new(:vendor, "#{::RAILS_ROOT}/vendor/generators") - sources << PathSource.new(:plugins, "#{::RAILS_ROOT}/vendor/plugins/*/**/generators") - sources << PathSource.new(:plugins, "#{::RAILS_ROOT}/vendor/plugins/*/**/rails_generators") + Rails.configuration.plugin_paths.each do |path| + relative_path = Pathname.new(File.expand_path(path)).relative_path_from(Pathname.new(::RAILS_ROOT)) + sources << PathSource.new(:"plugins (#{relative_path})", "#{path}/**/{,rails_}generators") + end end sources << PathSource.new(:user, "#{Dir.user_home}/.rails/generators") if Object.const_defined?(:Gem) |