[Rubygems-developers] Weak Dependencies

Chad Fowler chad at chadfowler.com
Tue Oct 10 17:13:04 EDT 2006


On 10/10/06, Austin Ziegler <halostatue at gmail.com> wrote:
>
> I think that this had been discussed before: is it possible to
> consider the idea of weak dependencies now? Basically, something where
> I could mark Text::Format of making use of TeX::Hyphen or Text::Hyphen
> but not requiring either.
>
> There's at least one other case that I can think of where this would be
> useful.



I'd like to see this too.  There are cases where  optional dependencies
improve an experience but aren't required.  An example I can think of is
RIch's semitar library, which uses a C extension if the extension exists and
falls back on a pure Ruby version if not.  I would think we could easily add
an attribute to dependencies that would be specified like this:

s.add_dependency("fastercsv", [">= 0.1.0"], :optional => true)

I'm not sure yet how I'd want to see the installer behave if there's an
optional dependency.  Prompt by default?  Warn but not prompt?

Chad
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://rubyforge.org/pipermail/rubygems-developers/attachments/20061010/7f2436f2/attachment.html 


More information about the Rubygems-developers mailing list