Skip to content

Instantly share code, notes, and snippets.

@jacobo
Created April 15, 2013 22:10
Show Gist options
  • Select an option

  • Save jacobo/5391690 to your computer and use it in GitHub Desktop.

Select an option

Save jacobo/5391690 to your computer and use it in GitHub Desktop.
debugging in the console
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