diff options
author | José Valim <jose.valim@gmail.com> | 2010-09-04 01:11:22 +0200 |
---|---|---|
committer | José Valim <jose.valim@gmail.com> | 2010-09-04 01:11:22 +0200 |
commit | f9c21ce6580601109a6c4ac55c63bdea031f3203 (patch) | |
tree | feefe3d00ea1dc233837807177a23a7e08427ec7 /railties/lib/rails/plugin.rb | |
parent | 6f194bb3a919e074885751f41aba0848937e37f1 (diff) | |
download | rails-f9c21ce6580601109a6c4ac55c63bdea031f3203.tar.gz rails-f9c21ce6580601109a6c4ac55c63bdea031f3203.tar.bz2 rails-f9c21ce6580601109a6c4ac55c63bdea031f3203.zip |
Remove more deprecated behavior from plugins.
Diffstat (limited to 'railties/lib/rails/plugin.rb')
-rw-r--r-- | railties/lib/rails/plugin.rb | 22 |
1 files changed, 3 insertions, 19 deletions
diff --git a/railties/lib/rails/plugin.rb b/railties/lib/rails/plugin.rb index c07ff2f9cf..5614624673 100644 --- a/railties/lib/rails/plugin.rb +++ b/railties/lib/rails/plugin.rb @@ -52,19 +52,6 @@ module Rails name.to_s end - def load_tasks - super - load_deprecated_tasks - end - - def load_deprecated_tasks - tasks = Dir["#{root}/{tasks,rails/tasks}/**/*.rake"].sort - if tasks.any? - ActiveSupport::Deprecation.warn "Rake tasks in #{tasks.to_sentence} are deprecated. Use lib/tasks instead" - tasks.each { |ext| load(ext) } - end - end - def initialize(root) @name = File.basename(root).to_sym config.root = root @@ -85,15 +72,12 @@ module Rails end initializer :load_init_rb, :before => :load_config_initializers do |app| - files = %w(rails/init.rb init.rb).map { |path| File.expand_path path, root } - if initrb = files.find { |path| File.file? path } - if initrb == files.first - ActiveSupport::Deprecation.warn "Use toplevel init.rb; rails/init.rb is deprecated: #{initrb}" - end + init_rb = File.expand_path("init.rb", root) + if File.file?(init_rb) config = app.config # TODO: think about evaling initrb in context of Engine (currently it's # always evaled in context of Rails::Application) - eval(File.read(initrb), binding, initrb) + eval(File.read(init_rb), binding, init_rb) end end |