Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge pull request #4 from kibenimatik/master

Require option
  • Loading branch information...
commit 5d4d0566f3513b3ebbd87ce21675cc9715bc45ef 2 parents 12397cc + 115f158
☃ pitr pitr authored
1  README.markdown
View
@@ -45,6 +45,7 @@ You can customize the sidekiq task via the following options:
* `concurrency`: the number of threads to include (defaults to `1`)
* `verbose`: whether to use verbose logging (defaults to `nil`)
* `stop_signal`: how to kill the process when restarting (defaults to `TERM`)
+* `require`: location of rails application with workers or file to require (defaults to `nil`)
## Development
2  lib/guard/sidekiq.rb
View
@@ -16,6 +16,7 @@ class Sidekiq < Guard
# - :concurrency, e.g. 20
# - :verbose e.g. true
# - :stop_signal e.g. :TERM, :QUIT or :SIGQUIT
+ # - :require e.g. ./sidekiq_helper.rb
def initialize(watchers = [], options = {})
@options = options
@pid = nil
@@ -87,6 +88,7 @@ def cmd
command << "--verbose" if @options[:verbose]
command << "--environment #{@options[:environment]}" if @options[:environment]
command << "--timeout #{@options[:timeout]}" if @options[:timeout]
+ command << "--require #{@options[:require]}" if @options[:require]
command << "--concurrency #{@options[:concurrency]}"
command.join(' ')
5 spec/guard/sidekiq_spec.rb
View
@@ -44,6 +44,11 @@
obj.send(:cmd).should include '--verbose'
end
+ it 'should accept :require option' do
+ obj = Guard::Sidekiq.new [], :require => './sidekiq_helper.rb'
+ obj.send(:cmd).should include '--require ./sidekiq_helper.rb'
+ end
+
it 'should provide default options' do
obj = Guard::Sidekiq.new []
obj.send(:cmd).should include "--concurrency #{Guard::Sidekiq::DEFAULT_CONCURRENCY}"
Please sign in to comment.
Something went wrong with that request. Please try again.