Skip to content

Instantly share code, notes, and snippets.

@jugyo
Created February 7, 2013 02:39
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 jugyo/4727965 to your computer and use it in GitHub Desktop.
Save jugyo/4727965 to your computer and use it in GitHub Desktop.
earthquake.gem plugin
Earthquake.once do
require 'webmock'
require 'logger'
logger = Logger.new(File.join(Earthquake.config[:dir], 'api.log'))
WebMock.allow_net_connect!
WebMock.after_request do |request, response|
logger.info "#{request.method.upcase} #{request.uri} #{request.body}"
logger.info response.status.join(' ')
logger.info response.body
logger.info response.headers.map {|key, val| "#{key}: #{val}" }.join("\n")
logger.info '-' * 80
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment