This project is archived and is in readonly mode.

#4367 ✓stale
jaswope

[PATCH] Using Sinatra as middleware fails

Reported by jaswope | April 12th, 2010 @ 02:58 AM | in 2.3.10

When trying to use Sinatra (or any rack middleware that is capable of running as a singleton) the app stack fails to initialize. This is due to the middleware stack using #respond_to?(:call) to test if a piece of middleware is a Proc. Since Sinatra can respond to call without being initialized, and because it requires the Rack environment to be passed to it, the initialization.

Attached is a proposed patch to replace #respond_to?(:call) with #is_a?(Proc). Tests still pass after this change, and I have made the change using 2-3-stable as my base.

Comments and changes to this ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile »

<h2 style="font-size: 14px">Tickets have moved to Github</h2>

The new ticket tracker is available at <a href="https://github.com/rails/rails/issues">https://github.com/rails/rails/issues</a>

Pages