Re: Strange behavior with RubyAuthenHandler on ruby 1.8.1 + modruby 1.0.7

LHERBIER Lois <[email protected]>
Newsgroups gmane.comp.apache.mod-ruby
Message-ID <[email protected]>
hi,

Shugo Maeda wrote:

>It seems that my patch is not commited to the ruby_1_8 branch.
>Did you applied my patch?
>  
>
I didn't apply your patch yet.
I use binairies packages for Ruby right now. I will reply to the ML when 
I will test this patch.

>Apache::RubyRun load scripts by "load(xx, true)", so test.rbx
>is evaluated in an anonymous module.
>  
>
(..)

>You can test it without mod_ruby like this:
>
>$ cd /home/test/bug/
>$ ruby1.8 -v -rcgi -I lib -r bar/auth -e 'load("test.rbx", true)' < /dev/null
>ruby 1.8.1 (2004-02-03) [i386-linux]
>bar/auth loaded
>bar/foo loaded
>./test.rbx:2: warning: main#include in the wrapped load is effective only for toplevel
>Content-Type: text/html
> 
>./test.rbx:5: uninitialized constant #<Module:0x40322a6c>::Foo (NameError)
>        from -e:1:in `load'
>        from -e:1
>
>Strangely, it works if I added 'require "cgi"' to test.rbx and
>remove -rcgi from the command line option.
>There may be more bugs in ruby.
>  
>
Very strange, in fact it works on my Ruby version. (Debian/testing binaries)

$ ruby1.8 -v -rcgi -I libs -r bar/auth -e 'load("test.rbx", true)' < /dev/null

ruby 1.8.1 (2004-02-03) [i386-linux]
Content-Type: text/html
 
Foo!

No changes on ouput with the 'require "cgi"' line into test.rbx


Thanks for your help and your explanations Shugo.

      Loïs
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.