Open stuartellis opened 12 years ago
Nice to know about this, thanks for sharing!
For completeness - Rack also includes a middleware for code reloading:
https://github.com/codereading/rack/blob/rack-1.4/lib/rack/reloader.rb
I quite like Shotgun because it doesn't require you to add anything to your own code.
Thank @stuartellis, good to know Shotgun doesn't work on JRuby.
An interesting article here: http://rkh.im/code-reloading
thanks @stuartellis, very practical info I just put to good use!
and thanks @samnang for the rkh article which is a great walkthrough of various reloading techniques and pitfalls.
If you are writing a Rack or Sinatra application then it's worth knowing about the code reloaders...
These reload your code on every request (like Rails does in development), so that you can just save and refresh your browser to run the latest version.
Sinatra has a reloader in sinatra-contrib:
https://github.com/sinatra/sinatra-contrib/blob/master/lib/sinatra/reloader.rb
Shotgun works for any Rack application (but isn't compatible with JRuby):
https://github.com/rtomayko/shotgun