Re: auto-reload issue
Shugo Maeda <[email protected]> Wed, 09 May 2007 11:44:20 +0900
| Newsgroups | gmane.comp.apache.mod-ruby |
|---|---|
| Message-ID | <[email protected]> |
Hi, On 5/8/2007 11:36 PM, Dennis Sutch wrote: > > <VirtualHost *:80> > > SetHandler ruby-object > > RubyTimeOut 30 > > RubyRequire auto-reload > > RubyAddPath /var/www/myapp/bin > > RubyRequire myapp > > RubyHandler MyApp.instance > > </VirtualHost> > > > I've created a myapp-loader.rb and required that with RubyRequire. The > myapp-loader requires myapp. > > In other words: RubyRequire loads myapp-loader.rb, which in turn loads > myapp.rb, which then loads other Ruby scripts. Using this method, > should auto-reload notice changes to any script other than myapp-loader.rb? auto-reload doesn't reload scripts in this situation. Because top-level require in myapp-loader.rb is called only once. auto-reload just replace buitin require, so if require isn't called, nothing happens. You should place require in the handler method in your MyApp to reload scripts on each request. Shugo