diff options
author | Piotr Sarnacki <drogus@gmail.com> | 2010-07-19 17:53:14 +0200 |
---|---|---|
committer | Piotr Sarnacki <drogus@gmail.com> | 2010-09-03 22:59:05 +0200 |
commit | 32a5b49911b88e8e410583d382e8253004abce50 (patch) | |
tree | 292bf3c88524241e8740b34a937937b08b3b00b0 /railties/lib/rails/application.rb | |
parent | 939d4255e690bd0406179cad00836975273fd49e (diff) | |
download | rails-32a5b49911b88e8e410583d382e8253004abce50.tar.gz rails-32a5b49911b88e8e410583d382e8253004abce50.tar.bz2 rails-32a5b49911b88e8e410583d382e8253004abce50.zip |
Move singleton pattern to Railtie and remove Engine::Configurable and Application::Configurable in favor of unified Railtie::Configurable
Diffstat (limited to 'railties/lib/rails/application.rb')
-rw-r--r-- | railties/lib/rails/application.rb | 29 |
1 files changed, 4 insertions, 25 deletions
diff --git a/railties/lib/rails/application.rb b/railties/lib/rails/application.rb index cbb1aad68f..fee99faf43 100644 --- a/railties/lib/rails/application.rb +++ b/railties/lib/rails/application.rb @@ -41,20 +41,6 @@ module Rails autoload :Railties, 'rails/application/railties' class << self - private :new - - def instance - if self == Rails::Application - if Rails.application - ActiveSupport::Deprecation.warn "Calling a method in Rails::Application is deprecated, " << - "please call it directly in your application constant #{Rails.application.class.name}.", caller - end - Rails.application - else - @@instance ||= new - end - end - def inherited(base) raise "You cannot have more than one Rails::Application" if Rails.application super @@ -62,15 +48,8 @@ module Rails Rails.application.add_lib_to_load_path! ActiveSupport.run_load_hooks(:before_configuration, base.instance) end - - def respond_to?(*args) - super || instance.respond_to?(*args) - end - end - delegate :middleware, :to => :config - # This method is called just after an application inherits from Rails::Application, # allowing the developer to load classes in lib and use them during application # configuration. @@ -99,10 +78,6 @@ module Rails super end - def railties - @railties ||= Railties.new(config) - end - def routes_reloader @routes_reloader ||= ActiveSupport::FileUpdateChecker.new([]){ reload_routes! } end @@ -163,6 +138,10 @@ module Rails initializers end + def config + @config ||= Application::Configuration.new(find_root_with_flag("config.ru", Dir.pwd)) + end + protected def default_middleware_stack |