From 2110a524a4913815d036786aa01319fd67db0ee2 Mon Sep 17 00:00:00 2001 From: Carl Lerche Date: Fri, 16 Oct 2009 12:49:39 -0700 Subject: Deprecate RAILS_ROOT in favor of Rails.root (which proxies to the application's object root) --- railties/lib/rails/tasks/framework.rake | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'railties/lib/rails/tasks/framework.rake') diff --git a/railties/lib/rails/tasks/framework.rake b/railties/lib/rails/tasks/framework.rake index 16dd0af44e..3d7e4b5453 100644 --- a/railties/lib/rails/tasks/framework.rake +++ b/railties/lib/rails/tasks/framework.rake @@ -86,7 +86,7 @@ namespace :rails do template = File.expand_path(template) if template !~ %r{\A[A-Za-z][A-Za-z0-9+\-\.]*://} require 'generators' - generator = Rails::Generators::App.new [ RAILS_ROOT ], {}, :destination_root => RAILS_ROOT + generator = Rails::Generators::App.new [ Rails.root ], {}, :destination_root => Rails.root generator.apply template, :verbose => false end @@ -96,7 +96,7 @@ namespace :rails do require 'rails/generators/rails/app/app_generator' generator = Rails::Generators::AppGenerator.new ["rails"], { :with_dispatchers => true }, - :destination_root => RAILS_ROOT + :destination_root => Rails.root generator.invoke(method) end @@ -117,8 +117,8 @@ namespace :rails do desc "Rename application.rb to application_controller.rb" task :application_controller do - old_style = RAILS_ROOT + '/app/controllers/application.rb' - new_style = RAILS_ROOT + '/app/controllers/application_controller.rb' + old_style = Rails.root + '/app/controllers/application.rb' + new_style = Rails.root + '/app/controllers/application_controller.rb' if File.exists?(old_style) && !File.exists?(new_style) FileUtils.mv(old_style, new_style) puts "#{old_style} has been renamed to #{new_style}, update your SCM as necessary" -- cgit v1.2.3