Permalink
Browse files

Delegate App calls to instance

  • Loading branch information...
1 parent d618b7e commit 2db14457f483cf582acf244f89ddff08a16155f3 @josh josh committed Jan 22, 2010
@@ -1,4 +1,4 @@
# This file is used by Rack-based servers to start the application.
require ::File.expand_path('../config/environment', __FILE__)
-run <%= app_const %>.instance
+run <%= app_const %>
@@ -2,4 +2,4 @@ require File.expand_path('../../config/boot', __FILE__)
require 'rails/commands/console'
require File.expand_path('../../config/application', __FILE__)
-Rails::Console.start(<%= app_const %>.instance)
+Rails::Console.start(<%= app_const %>)
@@ -2,4 +2,4 @@ require File.expand_path('../../config/boot', __FILE__)
require 'rails/commands/dbconsole'
require File.expand_path('../../config/application', __FILE__)
-Rails::DBConsole.start(<%= app_const %>.instance)
+Rails::DBConsole.start(<%= app_const %>)
@@ -8,7 +8,13 @@ class Application
class << self
attr_writer :config
alias configure class_eval
- delegate :initialize!, :load_tasks, :load_generators, :root, :to => :instance
+ delegate :call,
+ :initialize!,
+ :load_generators,
+ :load_tasks,
+ :middleware,
+ :root,
+ :to => :instance
private :new
def instance
@@ -76,7 +76,7 @@ def boot!
end
def middleware
- AppTemplate::Application.instance.middleware.active.map(&:klass).map(&:name)
+ AppTemplate::Application.middleware.active.map(&:klass).map(&:name)
end
end
end

0 comments on commit 2db1445

Please sign in to comment.