[prev in list] [next in list] [prev in thread] [next in thread] 

List:       ruby-core
Subject:    Re: [BUG?] require
From:       Christian Neukirchen <chneukirchen () gmail ! com>
Date:       2005-06-08 17:49:38
Message-ID: m24qc8ybyt.fsf () lilith ! local
[Download RAW message or body]

ES <ruby-ml@magical-cat.org> writes:

> Le 8/6/2005, "Kirill A. Shutemov" <k.shutemov@sam-solutions.net> a
> écrit:
>>I think this is bug:
>>
>>irb(main):001:0> File.open("test.rb","w"){|file|
>>irb(main):002:1* file << "Const = 1"
>>irb(main):003:1> }
>>=> #<File:test.rb (closed)>
>>irb(main):004:0> require 'test.rb'
>>=> true
>>irb(main):005:0> require './test.rb'
>>./test.rb:1: warning: already initialized constant Const
>>=> true
>>
>>require loads twice same file. I think to $" should add absolute path not
>>relative. What do you think?
>
> Yes, and just the equivalent of File.expand_path in
> #require would work fine, I presume.
>
>>Kirill A. Shutemov

Which is done in Ruby 1.9 IIRC.

> E
-- 
Christian Neukirchen  <chneukirchen@gmail.com>  http://chneukirchen.org


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic