unbewusst.sein
5/10/2008 9:11:00 AM
i'm using cgi under mod_ruby with Apache2.
i've found something strange, to me :
my code extends the Array class :
class Array
def include_page?(a)
self.each {|p| return true if p===(a)}
return false
end
end
the method ===() being defined in the class Page :
class Page
include ManPage
attr_accessor :manpath,:section,:page,:count,:key
def initialize(manpath,section,page)
[...]
def ===(a)
return false unless a.class == Page
return
self.manpath===a.manpath&&self.section===a.section&&self.page===a.page
end
[...]
end
if i test those methods (include_page?(a) and ===(a)) apart from cgi and
mod_ruby, everything is OK;
however, under mod_ruby and cgi, include_page?(a) returns always false.
requirements in the first case :
require 'manpage'
include ManPage
requirements in the second case (with cgi and mod_ruby)
require 'man_rep/manpage'
require 'rubygems'
require 'cgi'
require 'pstore'
include ManPage
does it means cgi does something behind the scene ?
--
Une Bévue