diff options
author | David Heinemeier Hansson <david@loudthinking.com> | 2008-11-26 20:03:25 +0100 |
---|---|---|
committer | David Heinemeier Hansson <david@loudthinking.com> | 2008-11-26 20:03:25 +0100 |
commit | 4999d52e08a02ebba344f6c318f0af4b5b18f0e5 (patch) | |
tree | f0d2af329fb961b6619ee5f2c21666168f8bb321 /railties/lib/rails/plugin/loader.rb | |
parent | 40b40c487040d9c721d486e8ec8cfbc53a8cd79a (diff) | |
download | rails-4999d52e08a02ebba344f6c318f0af4b5b18f0e5.tar.gz rails-4999d52e08a02ebba344f6c318f0af4b5b18f0e5.tar.bz2 rails-4999d52e08a02ebba344f6c318f0af4b5b18f0e5.zip |
Added that config/routes.rb files in engine plugins are automatically loaded (and reloaded when they change in dev mode) [DHH]
Diffstat (limited to 'railties/lib/rails/plugin/loader.rb')
-rw-r--r-- | railties/lib/rails/plugin/loader.rb | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/railties/lib/rails/plugin/loader.rb b/railties/lib/rails/plugin/loader.rb index 8d7eac53c5..ba3f67d1d0 100644 --- a/railties/lib/rails/plugin/loader.rb +++ b/railties/lib/rails/plugin/loader.rb @@ -22,6 +22,11 @@ module Rails @plugins ||= all_plugins.select { |plugin| should_load?(plugin) }.sort { |p1, p2| order_plugins(p1, p2) } end + # Returns the plugins that are in engine-form (have an app/ directory) + def engines + @engines ||= plugins.select(&:engine?) + end + # Returns all the plugins that could be found by the current locators. def all_plugins @all_plugins ||= locate_plugins @@ -56,7 +61,17 @@ module Rails end $LOAD_PATH.uniq! - end + end + + # Returns an array of all the controller paths found inside engine-type plugins. + def controller_paths + engines.collect(&:controller_path) + end + + def routing_files + engines.select(&:routed?).collect(&:routing_file) + end + protected |