Guard::Shotgun automatically starts and restarts Rack applications (through
rackup) when needed. As useful as Shotgun when developing a Sinatra app.
- Tested on Ruby 1.9.2-p290 only.
- You are developing with Sinatra and you have to restart your development server each time you change your source code?
- You are using Shotgun to do this, but well, the latest version is not showing the logs anymore in your console, which makes developing a little harder?
If you have answered 'yes' to any of these questions, you may find some use to this plugin.
Please be sure to have Guard installed before continue.
Install the gem:
gem install guard-shotgun
Or add it to your Gemfile (inside development group):
gem 'guard-shotgun', :git => https://github.com/rchampourlier/guard-shotgun.git
Add guard definition to your Guardfile by running this command:
guard init shotgun
This guard plugin is intended to be used when developing a Sinatra application, loaded through
It allows automatic reloading of your Sinatra server when a file is changed.
It provides the same service as the Shotgun gem, relying on Guard to watch for your files.
Please read Guard usage doc
For example, to look at the
main.rb file in your application directory, just set this guard:
guard 'shotgun' do watch('main.rb') end
Please read Guard doc for more info about Guardfile DSL.
Currently there is no option.
Killing Sinatra when reloading on change without waiting for requests to be completed.
- Add some options: host, port...
- Allow starting Sinatra applications without using rackup.
Help is welcome!
Pull requests are very welcome! Make sure your patches are well tested. Please create a topic branch for every separate change you make.