diff options
author | José Valim <jose.valim@gmail.com> | 2010-01-17 13:23:14 +0100 |
---|---|---|
committer | José Valim <jose.valim@gmail.com> | 2010-01-17 13:23:38 +0100 |
commit | 020e656447a7cc2ce9cbf83483ab3b31730a565e (patch) | |
tree | ea147ea25a768989e6aaaa57ea026dada4d2f053 /actionpack | |
parent | 27d9836ad3519d57462b86a4e539c1aa176b6d95 (diff) | |
download | rails-020e656447a7cc2ce9cbf83483ab3b31730a565e.tar.gz rails-020e656447a7cc2ce9cbf83483ab3b31730a565e.tar.bz2 rails-020e656447a7cc2ce9cbf83483ab3b31730a565e.zip |
Move middleware builder back to Rails::Rack::Metal without losing the new behavior.
Diffstat (limited to 'actionpack')
-rw-r--r-- | actionpack/lib/action_dispatch/railtie.rb | 29 |
1 files changed, 0 insertions, 29 deletions
diff --git a/actionpack/lib/action_dispatch/railtie.rb b/actionpack/lib/action_dispatch/railtie.rb index 9fd034cdd2..18978bfb39 100644 --- a/actionpack/lib/action_dispatch/railtie.rb +++ b/actionpack/lib/action_dispatch/railtie.rb @@ -8,35 +8,6 @@ module ActionDispatch require "action_dispatch/railties/subscriber" subscriber ActionDispatch::Railties::Subscriber.new - class MetalMiddlewareBuilder - def initialize(metals) - @metals = metals - end - - def new(app) - ActionDispatch::Cascade.new(@metals, app) - end - - def name - ActionDispatch::Cascade.name - end - alias_method :to_s, :name - end - - initializer "action_dispatch.initialize_metal" do |app| - metal_root = "#{Rails.root}/app/metal" - load_list = app.config.metals || Dir["#{metal_root}/**/*.rb"] - - metals = load_list.map { |metal| - metal = File.basename(metal.gsub("#{metal_root}/", ''), '.rb') - require_dependency metal - metal.camelize.constantize - }.compact - - middleware = MetalMiddlewareBuilder.new(metals) - app.config.middleware.insert_before(:"ActionDispatch::ParamsParser", middleware) - end - # Prepare dispatcher callbacks and run 'prepare' callbacks initializer "action_dispatch.prepare_dispatcher" do |app| # TODO: This used to say unless defined?(Dispatcher). Find out why and fix. |