On Sunday 22 May 2005 11:11 pm, Jeremy Hinegardner wrote: > I'm looking at a need for 'optional' dependencies. That is, given a > list of dependencies, at least one of them must be installed for the gem > to work. > > Possibly something like: > > spec = Gem::Specification.new do |s| > s.add_optional_dependency('SampleGem','>= 0.42.0') > s.add_optional_dependency('OptionalGem','>= 0.10.2') > end > > Then during the gem install phase rubygems would check and make sure > that either SampleGem or OptionalGem were installed. If neither were > then prompt to see which one the user would like to have installed. Or > possibly make one of the optional dependencies the default if neither is > installed. > > Thoughts anyone ? The problem is that once you get beyond simple dependencies, the requirements could become quite complicated. Satisfying a simple one out of a set of optional gems is only the start. The next person might need either gem A or gems B and C. Someone else needs Gem X on platform Y but Gem W on other platforms. What one really needs is a full constraint language to handle the arbitrary combinations. -- -- Jim Weirich jim / weirichhouse.org http://onestepback.org ----------------------------------------------------------------- "Beware of bugs in the above code; I have only proved it correct, not tried it." -- Donald Knuth (in a memo to Peter van Emde Boas)