Created
April 15, 2013 22:10
-
-
Save jacobo/5391690 to your computer and use it in GitHub Desktop.
debugging in the console
This file contains hidden or 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 SimpleViz | |
| def initialize(app, &lookup) | |
| @app = app | |
| end | |
| def call(env) | |
| puts caller | |
| request = Rack::Request.new(env) | |
| puts "-> #{request.request_method.upcase} (#{request.url})" | |
| status, headers, body = @app.call(env) | |
| puts "<--#{status}-- #{body.size}" | |
| [status, headers, body] | |
| end | |
| end | |
| Rack::Client::Simple.middlewares << SimpleViz |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment