Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

add zeus support #13

Open
wants to merge 1 commit into from

1 participant

@m0dd3r

Run resque rake commands through zeus instead of bundle exec. This follows roughly the same conventions used by guard-rspec for zeus support

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Mar 15, 2013
  1. @m0dd3r

    add zeus support

    m0dd3r authored
This page is out of date. Refresh to see the latest.
View
1  README.markdown
@@ -50,6 +50,7 @@ You can customize the resque task via the following options:
* `vverbose`: whether to use very verbose logging (defaults to `nil`)
* `trace`: whether to include `--trace` on the rake command (defaults to `nil`)
* `stop_signal`: how to kill the process when restarting (defaults to `QUIT`)
+* `zeus`: run resque through zeus (defaults to `false`)
## Development
View
8 lib/guard/resque.rb
@@ -21,6 +21,7 @@ class Resque < Guard
# - :vverbose e.g. true
# - :trace e.g. true
# - :stop_signal e.g. :QUIT or :SIGQUIT
+ # - :zeus e.g. true
def initialize(watchers = [], options = {})
@options = options
@pid = nil
@@ -28,6 +29,7 @@ def initialize(watchers = [], options = {})
@options[:queue] ||= DEFAULT_QUEUE
@options[:count] ||= DEFAULT_COUNT
@options[:task] ||= (@options[:count].to_i == 1) ? DEFAULT_TASK_SINGLE : DEFAULT_TASK_MULTIPLE
+ @options[:zeus] ||= false
super
end
@@ -85,7 +87,11 @@ def restart
private
def cmd
- command = ['bundle exec rake', @options[:task].to_s]
+ command = []
+ exec = @options[:zeus] ? 'zeus' : 'bundle exec'
+ command << exec
+ command << 'rake'
+ command << @options[:task].to_s
# trace setting
command << '--trace' if @options[:trace]
View
6 spec/guard/resque_spec.rb
@@ -47,6 +47,12 @@
obj.send(:cmd).should_not include Guard::Resque::DEFAULT_TASK_SINGLE
end
+ it 'should accept :zeus option' do
+ obj = Guard::Resque.new [], :zeus => true
+ obj.send(:cmd).should include 'zeus'
+ obj.send(:cmd).should_not include 'bundle exec'
+ end
+
it 'should provide default options' do
obj = Guard::Resque.new []
obj.send(:env).should include 'QUEUE' => Guard::Resque::DEFAULT_QUEUE.to_s
Something went wrong with that request. Please try again.