diff options
author | Joshua Peek <josh@joshpeek.com> | 2009-09-25 22:28:09 -0500 |
---|---|---|
committer | Joshua Peek <josh@joshpeek.com> | 2009-09-25 22:28:09 -0500 |
commit | 968c994c3b45147a822816d926a37c582c66859f (patch) | |
tree | a2c5a2a3b0d75360367cd254d1439412c136b9ef /railties | |
parent | dfbd3b94094d54483a47faa9d927370df476f572 (diff) | |
download | rails-968c994c3b45147a822816d926a37c582c66859f.tar.gz rails-968c994c3b45147a822816d926a37c582c66859f.tar.bz2 rails-968c994c3b45147a822816d926a37c582c66859f.zip |
Initializer.run returns an application object
Diffstat (limited to 'railties')
-rw-r--r-- | railties/lib/rails/application.rb | 2 | ||||
-rw-r--r-- | railties/lib/rails/core.rb | 8 | ||||
-rw-r--r-- | railties/lib/rails/initializer.rb | 8 |
3 files changed, 16 insertions, 2 deletions
diff --git a/railties/lib/rails/application.rb b/railties/lib/rails/application.rb index d762689794..d3057aaa11 100644 --- a/railties/lib/rails/application.rb +++ b/railties/lib/rails/application.rb @@ -1,5 +1,3 @@ -require 'action_controller' - module Rails class Application def initialize diff --git a/railties/lib/rails/core.rb b/railties/lib/rails/core.rb index 33695a27b9..4c2789746c 100644 --- a/railties/lib/rails/core.rb +++ b/railties/lib/rails/core.rb @@ -14,6 +14,14 @@ module Rails @@configuration = configuration end + def application + @@application + end + + def application=(application) + @@application = application + end + def initialized? @initialized || false end diff --git a/railties/lib/rails/initializer.rb b/railties/lib/rails/initializer.rb index b91e07d5c4..7501d4e0e2 100644 --- a/railties/lib/rails/initializer.rb +++ b/railties/lib/rails/initializer.rb @@ -1,5 +1,6 @@ require "pathname" +require 'rails/application' require 'rails/railties_path' require 'rails/version' require 'rails/gem_dependency' @@ -89,12 +90,15 @@ module Rails def run(initializer = nil) Rails.configuration = Base.config = @config + Rails.application = nil if initializer run_initializer(initializer) else @initializers.each {|block| run_initializer(block) } end + + Rails.application end end @@ -575,4 +579,8 @@ Run `rake gems:install` to install the missing gems. Rails::Generators.options.deep_merge! config.generators.options end end + + Initializer.default.add :build_application do + Rails.application = Rails::Application.new + end end |