[Rubygems-developers] autorequire functionality

Jim Weirich jim at weirichhouse.org
Fri Oct 21 13:13:40 EDT 2005

Austin is correct that "autorequire" was a bad idea and is deprecated at
the moment.

However ...

Alun.Eyre at aemedia.com said:
> (gem x) has a dependancy on (gem f)  which in turn expects a constant to
> have been defined within (gem a) before it runs.

If I understand this correctly, this sounds like a circular dependency.  X
depends upon F, which in turns depends upon X.  I strongly recommend one

(1) Move the constant in question to F, so it no longer has to depend upon
X.  This would break the dependency cycle.

(2) Or, move the constant in question to gem C, and have both X and F
depend upon C.  Again, this breaks the cycle.

(3) Or, merge X and F into a single gem XF, which breaks the cycle by the
fact you now only have one gem.

Dependency cycles at a package level is likely to cause other headaches
down the line, and not only with RubyGems.

-- Jim Weirich     jim at 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)

More information about the Rubygems-developers mailing list