aboutsummaryrefslogtreecommitdiffstats
path: root/railties/lib/rails_generator/lookup.rb
diff options
context:
space:
mode:
authorJeremy Kemper <jeremy@bitsweat.net>2005-12-09 23:06:04 +0000
committerJeremy Kemper <jeremy@bitsweat.net>2005-12-09 23:06:04 +0000
commit08309ba51a12eda2be2a8bd142255c14e78a2d4b (patch)
tree645ed399293500aa591b37ccfad7265a8d01613a /railties/lib/rails_generator/lookup.rb
parenta40b6fd034cf8eab57a21f6828287ad453933ab3 (diff)
downloadrails-08309ba51a12eda2be2a8bd142255c14e78a2d4b.tar.gz
rails-08309ba51a12eda2be2a8bd142255c14e78a2d4b.tar.bz2
rails-08309ba51a12eda2be2a8bd142255c14e78a2d4b.zip
Generator looks in vendor/generators also.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@3262 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'railties/lib/rails_generator/lookup.rb')
-rw-r--r--railties/lib/rails_generator/lookup.rb7
1 files changed, 5 insertions, 2 deletions
diff --git a/railties/lib/rails_generator/lookup.rb b/railties/lib/rails_generator/lookup.rb
index 9351c4c7c1..5e110e80bd 100644
--- a/railties/lib/rails_generator/lookup.rb
+++ b/railties/lib/rails_generator/lookup.rb
@@ -98,8 +98,11 @@ module Rails
# 4. Builtins. Model, controller, mailer, scaffold.
def use_component_sources!
reset_sources
- sources << PathSource.new(:app, "#{::RAILS_ROOT}/lib/generators") if defined? ::RAILS_ROOT
- sources << PathSource.new(:plugins, "#{::RAILS_ROOT}/vendor/plugins/**/generators") if defined? ::RAILS_ROOT
+ if defined? ::RAILS_ROOT
+ sources << PathSource.new(:app, "#{::RAILS_ROOT}/lib/generators")
+ sources << PathSource.new(:app, "#{::RAILS_ROOT}/vendor/generators")
+ sources << PathSource.new(:plugins, "#{::RAILS_ROOT}/vendor/plugins/**/generators")
+ end
sources << PathSource.new(:user, "#{Dir.user_home}/.rails/generators")
sources << GemSource.new if Object.const_defined?(:Gem)
sources << PathSource.new(:builtin, "#{File.dirname(__FILE__)}/generators/components")