Re: auto-reload issue

"Dennis Sutch" <[email protected]> Tue, 8 May 2007 10:36:49 -0400
Newsgroups gmane.comp.apache.mod-ruby
Message-ID <[email protected]>
------=_Part_38813_15031837.1178635009998
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

Thanks for the response.

Is there something else that I need to do? (see below)

On 5/8/07, Shugo Maeda <[email protected]> wrote:
>
>
> auto-reload doesn't affect RubyRequire.
> It only affects require in Ruby scripts.
>
> For example, the following script reload foo.rb when foo.rb is modified.
>
> test.rbx:
> require "foo"
> r = Apache.request
> r.content_type = "text/plain"
> ...
>
> > <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?

Yet, when changes are made to myapp or any of the scripts required by myapp,
those changes do not show up until Apache is restarted.  Is there something
else that I may need to do to make auto-reload work?

-- 
Dennis Sutch
[email protected]

------=_Part_38813_15031837.1178635009998
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

Thanks for the response.<br><br>Is there something else that I need to do? (see below)<br><br><div><span class="gmail_quote">On 5/8/07, <b class="gmail_sendername">Shugo Maeda</b> &lt;<a href="mailto:[email protected]">[email protected]
</a>&gt; wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><br>auto-reload doesn&#39;t affect RubyRequire.<br>It only affects require in Ruby scripts.
<br><br>For example, the following script reload foo.rb when foo.rb is modified.<br><br>test.rbx:<br>require &quot;foo&quot;<br>r = Apache.request<br>r.content_type = &quot;text/plain&quot;<br>...<br><br>&gt; &lt;VirtualHost *:80&gt;
<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; SetHandler ruby-object<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; RubyTimeOut 30<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; RubyRequire auto-reload<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; RubyAddPath /var/www/myapp/bin<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; RubyRequire myapp<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; RubyHandler MyApp.instance
<br>&gt; &lt;/VirtualHost&gt;<br></blockquote></div><br>I&#39;ve created a myapp-loader.rb and required that with RubyRequire.&nbsp; The myapp-loader requires myapp.<br><br>In other words: RubyRequire loads myapp-loader.rb, which in turn loads 
myapp.rb, which then loads other Ruby scripts.&nbsp; Using this method, should auto-reload notice changes to any script other than myapp-loader.rb?<br><br>Yet, when changes are made to myapp or any of the scripts required by myapp, those changes do not show up until Apache is restarted.&nbsp; Is there something else that I may need to do to make auto-reload work?
<br clear="all"><br>-- <br>Dennis Sutch<br><a href="mailto:[email protected]">[email protected]</a>

------=_Part_38813_15031837.1178635009998--