Note that there are some explanatory texts on larger screens.

plurals
  1. POReloading Sinatra app on every request on Windows
    primarykey
    data
    text
    <p>I've set up <code>Rack::Reload</code> according to this <a href="http://groups.google.com/group/sinatrarb/browse_thread/thread/a5cfc2b77a013a86" rel="noreferrer">thread</a></p> <pre><code># config.ru require 'rubygems' require 'sinatra' set :environment, :development require 'app' run Sinatra::Application # app.rb class Sinatra::Reloader &lt; Rack::Reloader def safe_load(file, mtime, stderr = $stderr) if file == Sinatra::Application.app_file ::Sinatra::Application.reset! stderr.puts "#{self.class}: reseting routes" end super end end configure(:development) { use Sinatra::Reloader } get '/' do 'foo' end </code></pre> <p>Running with thin via <code>thin start -R config.ru</code>, but it only reloads newly added routes. When I change already existing route, it still runs the old code.</p> <p>When I add new route, it correctly reloads it, so it is accessible, but it doesn't reload anything else.</p> <p>For example, if I changed routes to</p> <pre><code>get '/' do 'bar' end get '/foo' do 'baz' end </code></pre> <p>Than <code>/</code> would still serve <code>foo</code>, even though it has changed, but <code>/foo</code> would correctly reload and serve <code>baz</code>.</p> <p><strong>Is this normal behavior, or am I missing something?</strong> I'd expect whole source file to be reloaded. The only way around I can think of right now is restarting whole webserver when filesystem changes.</p> <p>I'm running on Windows Vista x64, so I can't use <strong>shotgun</strong> because of <code>fork()</code>.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload