Rack::Reloader support?

24 views
Skip to first unread message

Ted Milker

unread,
Aug 15, 2013, 9:00:50 AM8/15/13
to scor...@googlegroups.com
Is there something scorched does that prevents Rack::Reloader from working?

I'm still learning about how to work with rack more directly so maybe I'm doing something wrong.  I just threw

use Rack::Reloader

into my config.ru for a simple, single file app but the output doesn't change when I change the file.

Tom Wardrop

unread,
Aug 15, 2013, 6:55:40 PM8/15/13
to
I imagine it's for a similar reason to this...


Rack::Reloader reloads all files back into the same running instance of Ruby, which means the result is virtually the same as this...

class App < Scorched::Controller
 
get '/' do
   
'hello'
 
end
end

class App < Scorched::Controller
 
get '/' do
   
"g'day"
 
end
end

That works in Ruby because obviously it allows classes to be re-opened, but alas, the new route is simply added to the end of the existing list of mappings. I recommend using `shotgun` for apps with a quick boot time, or otherwise `rerun -p "**/*.rb"` for apps with a longer boot process.

Tom
Reply all
Reply to author
Forward
0 new messages