Guard::Qu automatically starts/stops/restarts qu workers
forked from Guard::Resque
Please be sure to have Guard installed before continue.
Install the gem:
gem install guard-qu
Add it to your Gemfile (inside test group):
gem 'guard-qu'
Add guard definition to your Guardfile by running this command:
guard init qu
Please read Guard usage doc.
I suggest you put the qu guard definition before your test/rspec guard if your tests depend on it being active.
guard 'qu', :environment => 'development' do
watch(%r{^app/(.+)\.rb$})
watch(%r{^lib/(.+)\.rb$})
end
Feel free to be more specific, for example watching only for app/models
and app/jobs
to avoid reloading on a javascript file change.
You can customize the qu task via the following options:
environment
: the rails environment to run the workers in (defaults tonil
)task
: the name of the rake task to use (defaults to"qu:work"
)queue
: the qu queue to run (defaults to"default"
)trace
: whether to include--trace
on the rake command (defaults tonil
)stop_signal
: how to kill the process when restarting (defaults toTERM
)
- Source hosted at GitHub
- Report issues/Questions/Feature requests on GitHub Issues
Pull requests are very welcome! Make sure your patches are well tested. Please create a topic branch for every separate change you make.
Ideas for this gem came from Guard::WEBrick.
I hacked this together from the guard-resque
gem for use with Qu. All credit go to the original authors.