Skip to content

Instantly share code, notes, and snippets.

@brianpattison
Last active January 1, 2016 13:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save brianpattison/8153639 to your computer and use it in GitHub Desktop.
Save brianpattison/8153639 to your computer and use it in GitHub Desktop.
Inspecting octokit requests.
# https://github.com/drewbug/RackMotion
class GithubApiStub
def initialize(app)
@app = app
end
def call(request)
status, headers, data = @app.call(request)
if request.URL.absoluteString.start_with? "https://api.github.com"
ap "URL: #{request.URL.absoluteString}"
ap data
end
return status, headers, data
end
end
RackMotion.use GithubApiStub
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment