Skip to content

dblack/after_middles

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation



THIS PLUGIN HAS BEEN SUPERSEDED

by the per_action_mw (Per Action Middleware) plugin:

git://github.com/dblack/per_action_mw.git

Yes, it's all a moving target :-)


David Black



AfterMiddles
============

This is an experimental plugin to add a Rack-based after-filter-like layer
to ActionController. It requires Rails 2.3/edge. 

I've got the tests working as integration tests in an app on my machine.
They're a bit temperamental about working in the plugin directory itself, but
they pass.


Example
=======

You get an initialize method for free (@app = app).

  class MyRackApp
    def call(env)
      status, headers, response = @app.call(env)
      [status, headers, response]
    end
  end

  class ItemsController
    after_middle MyRackApp
  end

More information
================

The after_middle method is a wrapper around before_filter. It adds the
class you give it to an array, and then before the response is sent, the
array is turned into a middleware stack which is processed. 

Copyright (c) 2009 Ruby Power and Light, LLC. Released under the same terms
as Ruby itself. 

About

Experimental plugin to add Rack-based after_filter functionality to ActionController

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages