[MacRuby-devel] [MacRuby] #721: Compiled ruby files return incorrect values for __FILE__

MacRuby ruby-noreply at macosforge.org
Tue May 18 08:09:57 PDT 2010


#721: Compiled ruby files return incorrect values for __FILE__
---------------------------------+------------------------------------------
 Reporter:  mred@…               |       Owner:  lsansonetti@…        
     Type:  defect               |      Status:  new                  
 Priority:  major                |   Milestone:                       
Component:  MacRuby              |    Keywords:                       
---------------------------------+------------------------------------------
 Beginning with files "test_file.rb"

 {{{
 puts "__FILE__ = #{__FILE__}"
 }}}

 and "main.rb"

 {{{
 require 'test_file.rb'
 require 'test file.rbo'
 }}}

 arranged like this

 {{{
 /
   tmp
     ruby
       test_file.rb
     ruby2
       main.rb
 }}}

 I then issued the following commands starting in the /tmp directory

 {{{
 macruby -C ruby/test_file.rb -o ruby2/test_file.rbo
 mv ruby/test_file.rb ruby2
 cd ruby2
 macruby main.rb
 }}}

 and got the following results

 {{{
 __FILE__ = /tmp/ruby2/test_file.rb
 __FILE__ = ruby/test_file.rb
 }}}

 The incorrect __FILE__ values make it very difficult design a hierarchy of
 files and then load them using 'require' and relative paths for example.

-- 
Ticket URL: <http://www.macruby.org/trac/ticket/721>
MacRuby <http://macruby.org/>



More information about the MacRuby-devel mailing list