From: Eric Hodel Date: 2006-06-14T11:40:42+09:00 Subject: Re: Gemspec option to prevent auto-require? On Jun 13, 2006, at 7:23 PM, Gregory Brown wrote: > On 6/13/06, Eric Hodel wrote: > >> So I don't believe rubygems is at fault here. > > I decided to make a simple example gem to illustrate this. Here is > the Rakefile with simple spec > > require "rake/rdoctask" > require "rake/testtask" > require "rake/gempackagetask" > require "rubygems" > > spec = Gem::Specification.new do |spec| > spec.name = "dummie" > spec.version = "0.0.1" > spec.platform = Gem::Platform::RUBY > spec.summary = "A dummy lib" > spec.require_path = "lib" > spec.files = "lib/dumb.rb" > spec.add_dependency('ruport', '>= 0.1.0') What happens if you remove this line? > end > > Rake::GemPackageTask.new(spec) do |pkg| > pkg.need_zip = true > pkg.need_tar = true > end > > lib/dumb.rb actually is just an empty file. There are no requires. > If you unpack the gem once installing it, you can see this. > > Now take a look at this. > > [sandal@harmonix ~]$ irb -rubygems --simple-prompt >>> require "dumb" > => true >>> $LOADED_FEATURES.include? "faster_csv.rb" > => true > > Any reason why this should happen? > > Because this sounds like a bug, here is some system info. Do you have the RUBYOPT shell variable set? Do you have a .gemrc? .irbrc? > [sandal@harmonix ~]$ ruby -v > ruby 1.8.4 (2005-12-24) [i686-linux] > [sandal@harmonix ~]$ gem -v > 0.8.11 > [sandal@harmonix ~]$ rake --version > rake, version 0.7.1 > [sandal@harmonix ~]$ uname -a > Linux harmonix 2.6.16-ARCH #1 SMP PREEMPT Wed May 31 06:41:53 UTC 2006 > i686 Mobile AMD Sempron(tm) Processor 3000+ AuthenticAMD GNU/Linux -- Eric Hodel - drbrain@segment7.net - http://blog.segment7.net This implementation is HODEL-HASH-9600 compliant http://trackmap.robotcoop.com