Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Initializer.run returns an application object

  • Loading branch information...
commit 968c994c3b45147a822816d926a37c582c66859f 1 parent dfbd3b9
@josh josh authored
View
2  railties/lib/rails/application.rb
@@ -1,5 +1,3 @@
-require 'action_controller'
-
module Rails
class Application
def initialize
View
8 railties/lib/rails/core.rb
@@ -14,6 +14,14 @@ def configuration=(configuration)
@@configuration = configuration
end
+ def application
+ @@application
+ end
+
+ def application=(application)
+ @@application = application
+ end
+
def initialized?
@initialized || false
end
View
8 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 @@ def run_initializer(initializer)
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 @@ def self.run(initializer = nil, config = nil)
Rails::Generators.options.deep_merge! config.generators.options
end
end
+
+ Initializer.default.add :build_application do
+ Rails.application = Rails::Application.new
+ end
end

0 comments on commit 968c994

Please sign in to comment.
Something went wrong with that request. Please try again.