OK, so that's a third way.
So I guess I'm looking for this type of guidance,
If you need intercept the request to '...', use the before filter.
If you need intercept the request to '...', create a Rack Middleware
(I think this is what Tanner is saying below).
If you need intercept the request to '...', create a Sinatra
Extension (aka plugin).
On Apr 27, 2:48 pm, Tanner Burson <
tanner.bur...@gmail.com> wrote:
> For me the difference is this: do you need access/modify something before
> the Sinatra stack has been called? If not? Make it a plugin.
>
> On Mon, Apr 27, 2009 at 12:25 PM, KD <
inbox...@gmail.com> wrote:
>
> > -I've created a rack middleware in sinatra for some authentication
> > needs that just adds an authenticated boolean to the params hash that
> > can get checked down the line.
> > -I've created before filters to set the users language preference.
>
> > Beyond the ability to modify content post-call as you can with rack
> > middleware, I'm wondering what guidelines to consider in choosing one
> > of these approaches to intercept incoming requests?
>
> --
> ===Tanner Burson===
> tanner.bur...@gmail.comhttp://
www.tannerburson.com