carlhuda/bundler — Issue #1549: Proposal to add :override_version_dependency_with => "lib >= 1.5.0"
Author: naleksi
Created: 2011-11-23 15:29:00+00:00
State: open

Hello!

I recently faced a situation, which I believe is somewhat common, where one lib required nokogiri 1.4.0 and another nokogiri 1.5.0. Bundler barfed.

The rescue was to:
1) fork the other library source,
2) bump up the version dependency into nokogiri 1.5.0 for it,
3) run the test suite to check all is ok
4) push the change back
5) change my original Gemfile into gem "nokogiri", :git => "git@foo.com:myfork_of_lib_updated_to_nokogiri_1_5_0.git"

Then it worked. I also tried first to use local version of the gem through :path, but naturally the deployment to Heroku failed as it was not copying the sources.

Now, this is too much work for such a simple thing. Thus I'm proposing alternative rescue:

1) change original Gemfile into

gem "library_with_old_nokogiri_dep_to_1_4_0",
:override_version_dependency_with => ">= 'nokogiri' >= '1.5.0'"

Yes, the new option should be named sensibly. Yes, the part with => and >= after each other looks horrible. Likewise for the contents of the option. Maybe the contents could be an array of ['lib', '>=', '1.5.0'] instead, requiring no further parsing. And naturally this one step does not take into

Well, I guess the idea is clear. I posted this after it was suggested at freenode#ruby. Any opinions?