On Sun, Oct 06, 2002 at 09:44:41PM +0900, MoonWolf wrote:
> > How do I configure mod_ruby to run with a cached script?
> 
> ---------------------------------------------------------------------
> httpd.conf:
> <IfModule mod_ruby.c>
>   RubyRequire apache/ruby-run
>   RubyRequire apache/eruby-run
>   RubyRequire apache/myapp # Add
 
Is 'apache/myapp' a literal here?

>   <Location /myapp>

Is '/myapp' a literal here even if 'myapp.rb' is at
'RUBYLIB/ap;ache/myapp.rb' as indicated below?

>     SetHandler ruby-object
>     RubyHandler Apache::MyAppRun.instance

Where is 'Apache::MyAppRun.instance' defined?
The only thing I see defined is 'MyApp#handler'.

>   </Location>
> 
>   <Files *.rbx>
>     SetHandler ruby-object
>     RubyHandler Apache::RubyRun.instance
>   </Files>
> 
>   <Files *.rhtml>
>     SetHandler ruby-object
>     RubyHandler Apache::ERubyRun.instance
>   </Files>
> </IfModule>
> 
> ---------------------------------------------------------------------
> RUBYLIB/apache/myapp.rb:
> require 'singleton'
> 
> class MyApp
>   include Singleton
> 
>   def handler(r) 
>     # r = Apache::Request instance
>     # see http://www.modruby.net/doc/classes.en.html#label:7
>     <myapp script>
>     return Apache::OK
>   end
> end
> 
> -- 
> MoonWolf <moonwolf / moonwolf.com>
 
Thanks

-- 
Jim Freeze
----------
Programming Ruby 
 def initialize; fun; end
A language with class