app = Rack::Builder.new do
use Rack::CommonLogger
use Rack::Reloader # this is the interesting part
use Rack::ShowExceptions
run HelloWorld.new
end
For some reason, the Reloader script’s timestamp keeps getting updated each and every request. WTF? It’s as if the Reloader class kept getting reinitialized every single request.
It was.
app = Rack::Builder.new do
use Rack::CommonLogger
use Rack::Reloader # this is the interesting part
use Rack::ShowExceptions
run HelloWorld.new
end.to_app
The call to to_app
call wraps it up and prevents the classes from being reinitialized over and over.
Hmmm.