diff options
author | José Valim <jose.valim@gmail.com> | 2009-07-04 10:32:10 +0200 |
---|---|---|
committer | José Valim <jose.valim@gmail.com> | 2009-07-04 20:17:31 +0200 |
commit | cd388e075c363d80f9bba050bbc77d7a1a1e0e07 (patch) | |
tree | b3f9cc7c5a5502d7b3f921e7b1d07bb2f58dd273 /railties/lib/generators.rb | |
parent | 37ba0047a98279ad818744c5ab3b4bb5f3f3eef8 (diff) | |
download | rails-cd388e075c363d80f9bba050bbc77d7a1a1e0e07.tar.gz rails-cd388e075c363d80f9bba050bbc77d7a1a1e0e07.tar.bz2 rails-cd388e075c363d80f9bba050bbc77d7a1a1e0e07.zip |
Search for generators on vendorized plugins and gems.
Diffstat (limited to 'railties/lib/generators.rb')
-rw-r--r-- | railties/lib/generators.rb | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/railties/lib/generators.rb b/railties/lib/generators.rb index d513a3f6c7..83f1847598 100644 --- a/railties/lib/generators.rb +++ b/railties/lib/generators.rb @@ -20,13 +20,19 @@ module Rails # Generators load paths. First search on generators in the RAILS_ROOT, then # look for them in rails generators. # - # TODO Add plugins, gems and frozen gems to load path. + # TODO Right now, only plugin and frozen gems generators are loaded. Gems + # loaded by rubygems are not available since Rails dependencies system is + # being reworked. # def self.load_path @@load_path ||= begin paths = [] paths << File.expand_path(File.join(File.dirname(__FILE__), "generators")) - paths << File.join(RAILS_ROOT, "lib", "generators") if defined?(RAILS_ROOT) + if defined?(RAILS_ROOT) + paths += Dir[File.join(RAILS_ROOT, "vendor", "gems", "*", "lib", "generators")] + paths += Dir[File.join(RAILS_ROOT, "vendor", "plugins", "*", "lib", "generators")] + paths << File.join(RAILS_ROOT, "lib", "generators") + end paths end end |