From: Eric Hodel Date: 2007-08-21T05:42:30+09:00 Subject: Re: Current rubygems require idiom On Aug 20, 2007, at 10:20, ara.t.howard wrote: > On Aug 20, 2007, at 5:30 AM, Bil Kleb wrote: >> Hi, >> >> I currently have, >> >> begin >> require 'funit' >> rescue LoadError >> require 'rubygems' >> require 'funit' >> end >> >> What /should/ I be using? >> >> Thanks, >> -- >> Bil Kleb >> http://nasarb.rubyforge.org >> > > i personally use > > begin > require 'rubygems' > rescue LoadError > 42 > end > > require 'a' > require 'b' > require 'c' > require 'd' > > as it's quite a bit drier and easier to comment out the rubygems > when you want to test a 'normal' or otherwise non-rubygems install. No need to comment anything out, just use ruby -I to override RubyGems. So long as the files you require are already in $LOAD_PATH RubyGems won't activate any gems. -- Poor workers blame their tools. Good workers build better tools. The best workers get their tools to do the work for them. -- Syndicate Wars