From: Jeremy McAnally Date: 2007-01-21T15:51:34+09:00 Subject: Re: Getting the version number for rubygems? Maybe you should tell the Rails team because I'm fairly sure that's how they planned on handling it... http://dev.rubyonrails.org/ticket/6886 --Jeremy On 1/21/07, Eric Hodel wrote: > On Jan 20, 2007, at 21:03, Jeremy McAnally wrote: > > require 'rubygems' > > > > unless Kernel.respond_to? :gem > > alias gem require_gem > > end > > > > gem 'ruport' > > > > That should work I believe... > > NO! NO! NO! NO! NO! NO! NO! NO! NO! NO! NO! NO! NO! > > #gem and #require_gem do different things (autorequire). > > You'll screw over other gems by aliasing things around. > > Instead, just fall back to require_gem when gem isn't loaded. > > if Kernel.respond_to? :gem then > gem blah > else > require_gem blah > end > > DO NOT go aliasing methods on top of each other. #require and > #require_gem do different things, much like #sub and #sub! do > different things, respect that. > > -- > Eric Hodel - drbrain@segment7.net - http://blog.segment7.net > > I LIT YOUR GEM ON FIRE! > > > -- My free Ruby e-book: http://www.humblelittlerubybook.com/book/ My blogs: http://www.mrneighborly.com/ http://www.rubyinpractice.com/