Reloading Sinatra app on every request on Windows?

You can also try using Trinidad a JRuby Rack container based on Tomcat. In my experience it does change reloading by default without having to modify your source files. Bloody fast too.

Obviously no good if you are using native libraries, but if you are deploying on Windows you are probably used to adopting a pure-ruby approach Its syntax is just as simple as the thin approach: jruby -S trinidad -r config. Ru There is no Java specific yak shaving (i.e. Creating web.

Xml or WARing up your Ruby app) and the gem is simple to install.

You can also try using Trinidad a JRuby Rack container based on Tomcat. In my experience it does change reloading by default without having to modify your source files. Bloody fast too.

Obviously no good if you are using native libraries, but if you are deploying on Windows you are probably used to adopting a pure-ruby approach. Its syntax is just as simple as the thin approach: jruby -S trinidad -r config. Ru There is no Java specific yak shaving (i.e.

Creating web. Xml or WARing up your Ruby app) and the gem is simple to install.

You could try sinatra-reloader, which is known to work well on Windows (also, it's faster than shotgun).

– Konstantin Haase Jul 12 '10 at 13:12 1 We had this problem ourselves, since two of my team use Windows, and two are on Macs. This is the solution we went with, seems to be working well so far. – Joshua Cheek Jul 12 '10 at 14:02 2 not only faster but I find sinatra-reloader easier to use :-) – Radek Oct 13 '10 at 23:59.

This works: # config. Ru require 'rubygems' require 'app' set :environment, :development run Sinatra::Application # app. Rb require 'sinatra' class Sinatra::Reloader Expand_path(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 It matters from where you have the require statement. But I find the following solution more elegant and robust: # config. Ru require 'rubygems' require 'sinatra' require 'rack/reloader' require 'app' set :environment, :development use Rack::Reloader, 0 if development?

Run Sinatra::Application # app. Rb Sinatra::Application. Reset!

Get '/' do 'foo' end.

From the README: Shotgun This is an automatic reloading version of the rackup command that's shipped with Rack. It can be used as an alternative to the complex reloading logic provided by web frameworks or in environments that don't support application reloading. The shotgun command starts one of Rack's supported servers (e.g. , mongrel, thin, webrick) and listens for requests but does not load any part of the actual application.

Each time a request is received, it forks, loads the application in the child process, processes the request, and exits the child process. The result is clean, application-wide reloading of all source files and templates on each request.

Sorry, didn't see your note about Shotgun – Mike H Dec 17 '09 at 20:53.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions