From: Csaba Henk Date: 2005-03-18T11:24:54+09:00 Subject: Re: encapsulating rubygems so that my users don't need to be aware of it On 2005-03-18, Assaph Mehr wrote: > >> On 2005-03-17, Csaba Henk wrote: >> > %w(lib_a lib_b lib_c).each {|lib| >> > begin >> > require lib >> > rescue LoadError >> > begin >> > require rubygems >> > rescue LoadError >> else true # this is also needed here... >> > end and retry >> > end >> > } > > If the user has *no* version of the lib (i.e. not the gem and not the > regular version) you would get into an infinite loop here. Again, the critique is correct. Then forget all except my first and current post in this thread, and look at the one called "monster" in the first post. That does the job... > In Instiki/Pimki we tackle this like so: the tgz includes the libs > needed, while the gem version does not but does specify them as > dependencies. When starting we test if this is a gem or not and know > how to require the necessary libs. Does this help? Well, maybe I'll choose a different distribution scheme, but that's not the heart of the matter. The problem is that if you want to shield your users from package mana-gem-ent issues, you have to add clutter to your code, this way or that. As I read, you are doing this as well. I'm just looking for a somewhat "lite" or elegant solution. No dice yet. Maybe we have to live with it, until gems are either embraced properly and will be integrated into official ruby or will be completely discarded. This hanging-in-the-middle state is somewhat weird. Csaba