magnolia-fan/musicbrainz — pull request #3 by Applicat (2012-04-08 17:27:50+00:00)
Title: Caching of http requests

At first, this request sadly includes the last pull request about switching from rcov to simplecov. I have to improve my branching model.

So this request is about caching http requests by a cache block around get_contents.

Caching can be enabled by setting the cache_path e.g. through a Rails initializer file like this:

```ruby
MusicBrainz.cache_path = File.join(File.dirname(__FILE__), '../../tmp/test/musicbrainz')
```
The responses will be stored there according to "#{resource}/#{path.split('/').last}?#{query}"

This request also enables caching for the unit tests and reduces the execution time of "rake test" from ~ 60 seconds to ~ 17 seconds at the first run and ~ 0.09 seconds as of the second run.