Created
June 5, 2009 21:09
-
-
Save macournoyer/124505 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class PusherWare | |
def initialize(app) | |
@app = app | |
@pusher = Pusher::App.new | |
end | |
def call(env) | |
if env["PATH_INFO"] ~= /\/pusher/ | |
@pusher.call(env) | |
else | |
@app.call(env) | |
end | |
end | |
end | |
# in Sinatra | |
use PusherWare |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment