[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

ModRuby Init Handler

Vadim Shevchenko

8/3/2007 4:14:00 PM

Hello,

Apache 2.2.4
Ruby 1.8.6
mod_ruby 1.2.6

I try to use RubyInitHandler:

=========================
htaccess
==========================
RubyRequire myhandlers.rb

<Files *.html>
SetHandler ruby-object

RubyInitHandler MyInitHandler.instance
</Files>

==========================
myhandlers.rb
===========================

require 'singleton'

class MyInitHandler
include Singleton

def init( r )
raise 'in init'
end
end

===============================

1. Method "init" of my handler was not be called. Why?
2. I try to write wrong class name for RubyInitHandler, and also no
error:
RubyInitHandler _____MyInitHandler.instance
3. RubyFixupHandler works! All is OK.
--
Posted via http://www.ruby-....

1 Answer

Gale Cho

8/7/2007 7:13:00 PM

0

Are you trying to run Ruby scripts on Apache ?
You do not need mod_ruby for that.
All you need to do is, make some changes to your httpd.conf file. There
are two ways to do that.

http://httpd.apache.org/docs/1.3/misc/FAQ.html#CGIoutsideS...


Vadim Shevchenko wrote:
> Hello,
>
> Apache 2.2.4
> Ruby 1.8.6
> mod_ruby 1.2.6
>
> I try to use RubyInitHandler:
>
> =========================
> .htaccess
> ==========================
> RubyRequire myhandlers.rb
>
> <Files *.html>
> SetHandler ruby-object
>
> RubyInitHandler MyInitHandler.instance
> </Files>
>
> ==========================
> myhandlers.rb
> ===========================
>
> require 'singleton'
>
> class MyInitHandler
> include Singleton
>
> def init( r )
> raise 'in init'
> end
> end
>
> ===============================
>
> 1. Method "init" of my handler was not be called. Why?
> 2. I try to write wrong class name for RubyInitHandler, and also no
> error:
> RubyInitHandler _____MyInitHandler.instance
> 3. RubyFixupHandler works! All is OK.

--
Posted via http://www.ruby-....