diff options
Diffstat (limited to 'railties/lib/rails')
-rw-r--r-- | railties/lib/rails/application.rb | 8 | ||||
-rw-r--r-- | railties/lib/rails/plugin.rb | 4 |
2 files changed, 5 insertions, 7 deletions
diff --git a/railties/lib/rails/application.rb b/railties/lib/rails/application.rb index 91c866d0c9..d714c5ac41 100644 --- a/railties/lib/rails/application.rb +++ b/railties/lib/rails/application.rb @@ -72,13 +72,7 @@ module Rails def load_tasks require "rails/tasks" - # Load all extension rake tasks - # TODO: Make all plugin objects respond to :load_tasks - plugins.each do |plugin| - plugin.load_tasks if plugin.respond_to? :load_tasks - end - # Load all plugin tasks - Dir["#{root}/vendor/plugins/*/**/tasks/**/*.rake"].sort.each { |ext| load ext } + plugins.each { |p| p.load_tasks } # Load all application tasks # TODO: extract out the path to the rake tasks Dir["#{root}/lib/tasks/**/*.rake"].sort.each { |ext| load ext } diff --git a/railties/lib/rails/plugin.rb b/railties/lib/rails/plugin.rb index b5e6953fef..c64042cf7d 100644 --- a/railties/lib/rails/plugin.rb +++ b/railties/lib/rails/plugin.rb @@ -85,6 +85,10 @@ module Rails Dir["#{path}/{lib}", "#{path}/app/{models,controllers,helpers}"] end + def load_tasks + Dir["#{path}/**/tasks/**/*.rake"].sort.each { |ext| load ext } + end + initializer :add_to_load_path, :after => :set_autoload_paths do |app| load_paths.each do |path| $LOAD_PATH << path |