0.0
No commit activity in last 3 years
No release in over 3 years
When required, HTTPAutorec enables VCR (with WebMock) and all HTTP requests are cached in ./http_autorec_cache by default. You can temporarily enable it without modifying your code, like this: `ruby -rhttp_autorec your_script.rb`.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 1.6
>= 0

Runtime

~> 2.9
~> 1.17
 Project Readme

HTTPAutorec

HTTPAutorec is a handy tool to add transparent disk caching of HTTP response to your script. All you have to do is adding require 'http_autorec'.

Installation

Install it yourself as:

$ gem install http_autorec

Or add this line to your application's Gemfile:

gem 'http_autorec'

And then execute:

$ bundle

Usage

Add require 'http_autorec', or ruby -r http_autorec yourscript.rb.

Cache is put on ./http_autorec_cache by default. You can set the place of cache by HTTP_AUTOREC_DIR=http_cache ruby -r http_autorec yourscript.

How it works

HTTPAutorec uses VCR and WebMock. VCR records and replays HTTP responses, which are intercepted by WebMock.

WebMock supports a lot of HTTP libraries (check out webmock's readme), and so does HTTPAutorec.

Contributing

  1. Fork it ( https://github.com/vzvu3k6k/http_autorec/fork )
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create a new Pull Request

Related rubygems