diff options
author | Carl Lerche <carllerche@mac.com> | 2009-10-16 12:49:39 -0700 |
---|---|---|
committer | Carl Lerche <carllerche@mac.com> | 2009-10-16 12:51:02 -0700 |
commit | 2110a524a4913815d036786aa01319fd67db0ee2 (patch) | |
tree | f87858a81ac61642827c0617cad9eeceb44e8707 /railties/lib/rails/generators | |
parent | 6094e6516951444f8c3d6bb31f171af9fe96a02f (diff) | |
download | rails-2110a524a4913815d036786aa01319fd67db0ee2.tar.gz rails-2110a524a4913815d036786aa01319fd67db0ee2.tar.bz2 rails-2110a524a4913815d036786aa01319fd67db0ee2.zip |
Deprecate RAILS_ROOT in favor of Rails.root (which proxies to the application's object root)
Diffstat (limited to 'railties/lib/rails/generators')
3 files changed, 3 insertions, 6 deletions
diff --git a/railties/lib/rails/generators/base.rb b/railties/lib/rails/generators/base.rb index 720caa5b3f..7af99797ea 100644 --- a/railties/lib/rails/generators/base.rb +++ b/railties/lib/rails/generators/base.rb @@ -203,8 +203,8 @@ module Rails super base.source_root # Cache source root - if defined?(RAILS_ROOT) && base.name !~ /Base$/ - path = File.expand_path(File.join(RAILS_ROOT, 'lib', 'templates')) + if Rails.root && base.name !~ /Base$/ + path = File.expand_path(File.join(Rails.root, 'lib', 'templates')) if base.name.include?('::') base.source_paths << File.join(path, base.base_name, base.generator_name) else diff --git a/railties/lib/rails/generators/rails/app/templates/config/application.rb b/railties/lib/rails/generators/rails/app/templates/config/application.rb index bff74a7786..cf786093ba 100644 --- a/railties/lib/rails/generators/rails/app/templates/config/application.rb +++ b/railties/lib/rails/generators/rails/app/templates/config/application.rb @@ -7,7 +7,7 @@ Rails::Initializer.run do |config| # -- all .rb files in that directory are automatically loaded. # Add additional load paths for your own custom dirs - # config.load_paths += %W( #{RAILS_ROOT}/extras ) + # config.load_paths += %W( #{root}/extras ) # Specify gems that this application depends on and have them installed with rake gems:install # config.gem "bj" diff --git a/railties/lib/rails/generators/rails/app/templates/config/boot.rb b/railties/lib/rails/generators/rails/app/templates/config/boot.rb index 6e0e2279cd..12152a5d54 100644 --- a/railties/lib/rails/generators/rails/app/templates/config/boot.rb +++ b/railties/lib/rails/generators/rails/app/templates/config/boot.rb @@ -1,8 +1,6 @@ # Don't change this file! # Configure your app in config/environment.rb and config/environments/*.rb -RAILS_ROOT = "#{File.dirname(__FILE__)}/.." unless defined?(RAILS_ROOT) - module Rails # Mark the version of Rails that generated the boot.rb file. This is # a temporary solution and will most likely be removed as Rails 3.0 @@ -70,7 +68,6 @@ module Rails def load_initializer require "rails" install_gem_spec_stubs - Rails::GemDependency.add_frozen_gem_path end def install_gem_spec_stubs |