each uri to a repository can be replaced by an mirror uri via the bundler configuration. add mirrors like this
bundle config mirror.http://rubygems.org http://localhost:8081/nexus/content/repositories/rubygems.org
I am currently working on some ruby support for nexus https://github.com/sonatype/nexus-ruby-support
this plugin allows to mirror/proxy the gem repository from rubygems.org - that works fine with gem command itself, just replace rubygems.org with the mirror with gem sources. but with bundler there is no way to use that nexus-proxy without changing the Gemfile. this patch allows to tell bundler to use a mirror-uri instead of the uri from the Gemfile. that works fine with current state of the nexus-plugin (via the full index fallback) with keeping the Gemfile as it is.
this patch is also useful for other project setting up an mirror of rubygems.org and for the nexus plugin it feels essential to be able to use bundler with mirrors/proxies.
any thoughts ?
hoops - no tests/specs. they will come !
This pull request passes (merged b31f8371 into 8acc82f).
Recently started using the nexus rubygems proxy. It would be awesome to get this merged!
@tylerrhodes want to write specs for it? :)
add mirror support. each uri to a repository can be replaced by an
mirror uri via the bundler configuration. add mirrors like this
$ bundle config mirror.http://rubygems.org http://localhost:8081/nexus/content/repositories/rubygems.org
specs for mirror config
#2366 seems to be more "refined" to conventions. did not see it before I pushed my recent changes. but it would be nice to get the pull request in. currently I am using the monkey-patched version of bundler from https://github.com/sonatype/nexus-ruby-support/tree/master/nexus-gem - it is really hard to switch from "bundle install" to "nbundle install" (old habits die hard). the nexus gem proxy is getting close to a working state, too.
my specs fail on ruby18 - I stop this here in favour of #2366