Created
May 29, 2010 22:31
-
-
Save jlsync/418594 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 Jlproxy | |
def initialize(app) | |
@app = app | |
end | |
def call(env) | |
s = StringIO.new | |
$> = s | |
PP::pp env; | |
$> = STDOUT; | |
s.rewind | |
input = env['rack.input'].read | |
env['rack.input'].rewind | |
puts "\n\njlproxy_start\n\n#{s.read}\n\n#{input}\n\njlproxy_end\n\n" | |
result = @app.call(env) | |
#NOT RIGHT: puts "\n\nresult:\n\n" + result[2].readlines.join("\n") + "\n\n" | |
result | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment