http://groups.google.com/group/sinatrarb
I've copied the list on my response.
On Sun, Jun 14, 2009 at 11:58 PM, Satish Talim<ma...@satishtalim.com> wrote:
> 15th June
> Hello Ryan,
>
> We had interacted when I interviewed you for RubyLearning.
>
> Today, I upgraded to Sinatra 0.9.2 on Windows and realised that it no longer
> supports application reloading in development mode. Someone suggested
> Shotgun. As such, I installed it, but am unable to use the same.
Source file reloading was removed in Sinatra 0.9.2. The FAQ has some
details and suggestions for alternatives:
http://www.sinatrarb.com/faq.html#reloading
> a. Is a config.ru file necessary for a local app on my PC?
Nope. You can point shotgun at a Sinatra app file directly.
> b. Do I run a Sinatra app by typing:
>
> shotgun hello.rb
Yes. See `shotgun --help` for more advanced usage.
> c. How do I access the Sinatra app in my browser?
> http://localhost:9393/
Yes. You should receive output with the port number shotgun is listening on.
> Am I missing something?
Shotgun does not work on Windows or JRuby due to lack of sane fork(2)
on those platforms. Windows users may be able to use Rack::Reloader
for source file reloading. JRuby users may be able to get their web
container to perform reloading.
Thanks,
Ryan
Cheers,
--
Adam
Rack::Reloader is cool and very elegant but it wasn't working for me
for a couple of reasons:
* It only reloads .rb files that were 'require'd, not 'load'ed. That
leaves out (non-Erector) template files, and also, the way I was doing
it, sub-actions (see
http://groups.google.com/group/sinatrarb/browse_thread/thread/7329727a9296e96a#
).
* It doesn't reload configuration changes or other things that happen
during app startup.
* It does a "stat" on every file on every request which is quite
wasteful and also changes the subjective performance, so it's harder
to tell in development how your app will behave in production. Rerun
runs in a separate process, and if you're on a Mac it uses OS X's
built-in directory-watching facility so it's very low-impact.
And if you want to make a reloader of your own, please do! Let a
thousand flowers bloom... :-)
Not per each request, but per each while (number of seconds defined
inside Reloader).
Moreover "stat" isn't wasteful since it does NOT require any disk
access, usually last accessed inodes are cached by memory. (There's
even explaination about this in Rack docs AFAIR)
> And if you want to make a reloader of your own, please do! Let a
> thousand flowers bloom... :-)
Haha... but which one to pick if each is so pretty?
Cheers,
--
Adam