From: Bernard Lambeau Date: 2011-01-14T23:02:35+09:00 Subject: Re: Best practice to require external code dependency ? --0015175cf73cc91af20499cee279 Content-Type: text/plain; charset=ISO-8859-1 Thanks Luis, * If I write a pure library, your answer makes sense as the dependencies will be managed as you say. * The same is true when the code is invoked by rake, ok. * What if I have a bin/foo executable? Should I make something special there if I have version requirements on external libs ?? Thanks again! B On Fri, Jan 14, 2011 at 2:22 PM, Luis Lavena wrote: > On Jan 14, 6:46 am, Bernard Lambeau wrote: > > > > Do you see "enhancement of" / "agreement about" such a pattern? Any > reading > > I should further read ?? > > > > Use plain require. > > If you're working from Rake, which is already a gem, it will load > rubygems so no need for you to do the require. > > Also, having gem 'abc', '>= 0' is the same as doing the require of > that gem directly (it will always load the latest version), having > 'gem' in your code makes it already dependent on RubyGems, which > breaks the statements in your first link. > > I normally don't define any gem method in my libraries since my > dependencies will be loaded with the require (in case I'm creating a > gem that depends on other, RubyGems will active these dependencies > before I do require) > > -- > Luis Lavena > > --0015175cf73cc91af20499cee279--