diff options
author | José Valim <jose.valim@gmail.com> | 2010-01-24 09:47:55 +0100 |
---|---|---|
committer | José Valim <jose.valim@gmail.com> | 2010-01-24 10:03:03 +0100 |
commit | 25724c664d8af6c50903709da69a5871475383fe (patch) | |
tree | 55fa09b7dd4e538621e4bf33043d542af7e48912 /railties/lib/rails | |
parent | 5b26fa48755c461619f7d48f4cd28faa9db442f8 (diff) | |
download | rails-25724c664d8af6c50903709da69a5871475383fe.tar.gz rails-25724c664d8af6c50903709da69a5871475383fe.tar.bz2 rails-25724c664d8af6c50903709da69a5871475383fe.zip |
Load deprecated tasks for plugins.
Diffstat (limited to 'railties/lib/rails')
-rw-r--r-- | railties/lib/rails/plugin.rb | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/railties/lib/rails/plugin.rb b/railties/lib/rails/plugin.rb index 62dc7f30f8..b47679d140 100644 --- a/railties/lib/rails/plugin.rb +++ b/railties/lib/rails/plugin.rb @@ -23,6 +23,17 @@ module Rails attr_reader :name, :path + def load_tasks + super + extra_tasks = Dir["#{root}/{tasks,rails/tasks}/**/*.rake"] + + unless extra_tasks.empty? + ActiveSupport::Deprecation.warn "Having rake tasks in PLUGIN_PATH/tasks or " << + "PLUGIN_PATH/rails/tasks is deprecated. Use to PLUGIN_PATH/lib/tasks instead" + extra_tasks.sort.each { |ext| load(ext) } + end + end + def initialize(root) @name = File.basename(root).to_sym config.root = root |