diff options
| author | wycats <wycats@gmail.com> | 2010-05-29 20:07:47 +0200 | 
|---|---|---|
| committer | wycats <wycats@gmail.com> | 2010-05-29 20:08:00 +0200 | 
| commit | 45e60283e733a535d68d499aa20e095c905f43b0 (patch) | |
| tree | ee2fbf07bfca011623c928c0b24a7783925e8f88 /actionpack/lib/action_dispatch/middleware | |
| parent | 564ab4776c7e54268dc60e9a3fced7ba37657c72 (diff) | |
| download | rails-45e60283e733a535d68d499aa20e095c905f43b0.tar.gz rails-45e60283e733a535d68d499aa20e095c905f43b0.tar.bz2 rails-45e60283e733a535d68d499aa20e095c905f43b0.zip | |
Removing Metal from Rails 3. 
If you have existing Metals, you have a few options:
* if your metal behaves like a middleware, add it to the
  middleware stack via config.middleware.use. You can use
  methods on the middleware stack to control exactly where
  it should go
* if it behaves like a Rack endpoint, you can link to it
  in the router. This will result in more optimal routing
  time, and allows you to remove code in your endpoint
  that matches specific URLs in favor of the more powerful
  handling in the router itself.
For the future, you can use ActionController::Metal to get
a very fast controller with the ability to opt-in to specific
controller features without paying the penalty of the full
controller stack.
Since Rails 3 is closer to Rack, the Metal abstraction is
no longer needed.
Diffstat (limited to 'actionpack/lib/action_dispatch/middleware')
| -rw-r--r-- | actionpack/lib/action_dispatch/middleware/cascade.rb | 29 | 
1 files changed, 0 insertions, 29 deletions
| diff --git a/actionpack/lib/action_dispatch/middleware/cascade.rb b/actionpack/lib/action_dispatch/middleware/cascade.rb deleted file mode 100644 index 9f5c9891f0..0000000000 --- a/actionpack/lib/action_dispatch/middleware/cascade.rb +++ /dev/null @@ -1,29 +0,0 @@ -module ActionDispatch -  class Cascade -    def self.new(*apps) -      apps = apps.flatten - -      case apps.length -      when 0 -        raise ArgumentError, "app is required" -      when 1 -        apps.first -      else -        super(apps) -      end -    end - -    def initialize(apps) -      @apps = apps -    end - -    def call(env) -      result = nil -      @apps.each do |app| -        result = app.call(env) -        break unless result[1]["X-Cascade"] == "pass" -      end -      result -    end -  end -end | 
