Skip to content

Instantly share code, notes, and snippets.

@jlsync
Created May 29, 2010 22:31
Show Gist options
  • Save jlsync/418594 to your computer and use it in GitHub Desktop.
Save jlsync/418594 to your computer and use it in GitHub Desktop.
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