rubygems/rubygems — pull request #1075 by copiousfreetime (2014-11-23 01:22:13+00:00)
Title: Implementation of cache for the RemoteFetcher

## Implementation of Cache for RemoteFetcher

In short, it allows the `RemoteFetcher` to cache all of its requests in the location that was originally used to only by `Gem::Source` to cache the specs to disk.

## Detail list of changes

* creates a new class `RemoteFetcherCache` which is used by the `RemoteFetcher`
* adds a new top level directory in `PathSupport` of `fetch_cache_dir` which is then exposed at the `Gem` level in the same manner as `spec_cache_dir`
* uses an new environment variable `GEM_FETCH_CACHE` which is used to configure `fetch_cache_dir`.
* replaces the spec caching that was done in `Source` and allows `Source` to take advantage of the cache that is now built in to `RemoteFetcher`.
* the existing `spec_cache_dir` methods delegate to the new `fetch_cache_dir` methods
* the existing `GEM_SPEC_CACHE` environment is kept for backwards compatibility and is used to configure `fetch_cache_dir`

## Todo

* [ ] update guides / external documentation to demonstrate `GEM_FETCH_CACHE`
* [ ] additional testing, please let me of gaps in tests you see.